bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "break" inside a while-condition


From: Dan Douglas
Subject: Re: "break" inside a while-condition
Date: Tue, 11 Sep 2012 16:32:18 -0500
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

On Tuesday, September 11, 2012 04:40:41 PM Philippe Wang wrote:
> Repeat-By:
>   # 1) should raise a parsing error  (but it doesn't)
>   while break ; true ; do true ; done 

This doesn't cause a parsing error in any shell I have to test with. I don't 
see why it would.

>   # 2) should break the outer loop  (but it doesn't)
>   while true ; do while break ; do whatever-because-never-reached ; done ; 
> echo fail ; done

I don't think so. It should break the inner loop. "break 2" would break the 
outer loop. the "list" preceeding the "do" keyword is considered part of the 
loop. The same applies to "continue".
-- 
Dan Douglas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]