delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/12/02:55:32

X-Spam-Check-By: sourceware.org
Message-ID: <5283821.post@talk.nabble.com>
Date: Tue, 11 Jul 2006 23:55:20 -0700 (PDT)
From: prz <Guy DOT Przytula AT riziv DOT fgov DOT be>
To: cygwin AT cygwin DOT com
Subject: variable after break
MIME-Version: 1.0
X-Nabble-Sender: Guy DOT Przytula AT riziv DOT fgov DOT be
X-Nabble-From: prz <Guy DOT Przytula AT riziv DOT fgov DOT be>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019