?
Solved

while read logic in script file

Posted on 2004-09-03
2
Medium Priority
?
378 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 21

Accepted Solution

by:
tfewster earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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.
Suggested Courses

862 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