X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Kevin Markle Subject: Varibles not working in do loop... Date: Mon, 02 Apr 2007 15:38:11 -0400 Lines: 30 Message-ID: Reply-To: kmarkle AT pbs DOT org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/