Varibles not working in do loop...
Kevin Markle
kmarkle@pbs.org
Mon Apr 2 19:38:00 GMT 2007
Hello,
I'm running this script and line 19 works when I create the variablea
and type the command at a shell prompt. But when I try to run it from
within the for loop it does not return a value and hangs?
Thanks!
Kevin M
$ more test_forloop.sh
#FILE=`cat
"/cygdrive/e/wsus/group_1a_DEV/1group_1a_dev_clientlist.out"`
DIR="/cygdrive/e/wsus/group_1a_DEV/"
for t in `cat $DIR/1group_1a_dev_clientlist.out`
do
echo $t
#LOG=`ls -al $FILE | grep $T | grep WINDOWS | gawk '{print $9}'`
#LOG=`ls -al /cygdrive/e/wsus/group_1a_DEV/ | grep $t | grep WINDOWS |
gawk '{print $9}'`
LOG=`ls -al $DIR | grep $t | grep WINDOWS`
echo $t
echo The value of LOG is $LOG
UPDATES_NEEDED=`cat $LOG | grep "updates detected" | tail -1`
echo $UPDATES_NEEDED
done
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list