Solved

while read logic in script file

Posted on 2004-09-03
2
320 Views
Last Modified: 2013-12-27
I'm trying to create a script file that will checkin files to ClearCase, and I'm stuck on the "while read" logic.

Here's the part I'm stuck on:

find $2/* -type d > ~/dir_list

while read ~/dir_list
  do
    dir=`echo $dir_list`
    cleartool mkdir -nc $dir
    cleartool protect -chmod 775 $dir
  done < ~/dir_list

Originally the above script was setup to put the dir_list file in the ClearCase checkout directory,
And it did work that way, but I'm trying to set it up so that it puts the file in the user's home directory.
~/dir_list

To see the entire script, check out the following link:

http://axter.com/script/cm_add_elem.txt
What am I doing wrong with the variable names in the while loop?
0
Comment
Question by:Axter
2 Comments
 
LVL 20

Accepted Solution

by:
tfewster earned 500 total points
ID: 11976420
find $2/* -type d > ~/dir_list

while read DIR
  do
    echo $DIR
    cleartool mkdir -nc $DIR
    cleartool protect -chmod 775 $DIR
  done < ~/dir_list
0
 
LVL 30

Author Comment

by:Axter
ID: 11976604
Thanks, that works. :-)
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now