X-Spam-Check-By: sourceware.org Message-ID: <44B4B74A.1050500@gmail.com> Date: Wed, 12 Jul 2006 09:48:10 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) MIME-Version: 1.0 To: prz CC: cygwin@cygwin.com Subject: Re: variable after break References: <5283821.post@talk.nabble.com> In-Reply-To: <5283821.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit From: Dave Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Delivered-To: mailing list cygwin@cygwin.com prz wrote: > I am using a simple program with a loop > 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 ? I don't believe this is cygwin specific. Have a read of the bash man page. Hint: Not only are you reading the variable outside the loop in which you first declare it, you're also reading it outside the group command. From my reading of your command you shouldn't need to call grep, gawk, and use a while loop to match another string. gawk should be able to do everything for you. info gawk. Dave. -- 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/