• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

while read logic in script file

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
    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.

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

What am I doing wrong with the variable names in the while loop?
1 Solution
find $2/* -type d > ~/dir_list

while read DIR
    echo $DIR
    cleartool mkdir -nc $DIR
    cleartool protect -chmod 775 $DIR
  done < ~/dir_list
AxterAuthor Commented:
Thanks, that works. :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now