This is the mail archive of the
cygwin
mailing list for the Cygwin project.
variable after break
- From: prz <Guy dot Przytula at riziv dot fgov dot be>
- To: cygwin at cygwin dot com
- Date: Tue, 11 Jul 2006 23:55:20 -0700 (PDT)
- Subject: variable after break
I am using a simple program with a loop
#!/cygdrive/c/Cygwin/bin/bash
db2pd -d ddba -transaction | grep " $lw " | gawk '{ print $2" "$4}' | {
while read TREC
do
set - $TREC
tid=$2
aid=$1
echo "tid : $tid aid : $aid"
if [[ "${tid}" -eq ${lw} ]]
then
echo "break : aid : $aid "
break
fi
done
}
echo "aid : $aid " && [[ ! -z $DEBUG ]]
...
and the console print :
tid : 3 aid : 86
break : aid : 86
aid :
when getting out of the loop with break the variable $aid gets cleared
it was printed before the break and getting out of the loop
Any idea / hint ?
Thanks for all info
Best Regards, Guy Przytula
--
View this message in context: http://www.nabble.com/variable-after-break-tf1929303.html#a5283821
Sent from the Cygwin Users forum at Nabble.com.
--
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/