On 09/03/13 at 03:45pm, Joe Pfeiffer wrote:
> Stephen Powell <zlinux...@wowway.com> writes:
> >
> > Interesting.  If "break" appears out of context, you should get
> > an error message something like:
> >
> >    bash: break: only meaningful in a 'for', 'while', or 'until' loop
> >
> > You didn't get an error message, so part of bash thinks it is in context.
> > Yet it did not exit the loop.  It seems to me that you should get one
> > behavior or the other.  Either you should get an error message or it
> > should exit the loop.
> 
> Good point -- it is odd that it isn't giving the error message.

The loop context is inherited by the subshell, so break thinks it is fine. It
is only that it is totally meaningless to break there, since that signal cannot
be captured by parent shell environment. 

This seems to be expected behavior..

-- 
Liam

Attachment: signature.asc
Description: Digital signature

Reply via email to