Solved

while read logic in script file

Posted on 2004-09-03
2
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 21

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

Suggested Solutions

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
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…
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.
Suggested Courses

738 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