Ok. I ended up finding the answer right after writing the email.

cd /home/
dirs=`ls -d *`
cd /root
for II in $dirs; do
        TAR=`tar -czvf /root/$II.tgz /home/$II`
done


Thanks Steve

At 11:05 AM 3/28/2003 -0600, you wrote:
RedHat Linux 7.3
I am trying to create a backup script (/bin/sh type) that would read the directories and create a seperate backup file for each directory. I can easily get the directories into a text file with "ls -d *". How can I run through that script one line at a time putting the contents of the line into a variable, then do something with it?


foreach line in file{
        $variable="line contents"
        run some commands that need $variable contents
}

Thank You in advance for any help.

Steve




--
This message has been scanned for viruses and
dangerous content by the MailScanner at ow5, and is
believed to be clean.



--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to