This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Varibles not working in do loop...


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]