This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Varibles not working in do loop...
- From: Kevin Markle <kmarkle at pbs dot org>
- To: cygwin at cygwin dot com
- Date: Mon, 02 Apr 2007 15:38:11 -0400
- Subject: Varibles not working in do loop...
- Reply-to: kmarkle at pbs dot org
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/