On 7/19/16 7:15 PM, Dan Douglas wrote:
> Hi, I could reproduce this in all bash versions.
> 
> bash -c 'set -x; until continue; do :; done; echo test1'; echo test2
> + continue
> test2
> 
> I'm not actually sure whether this is supposed to work at all. Almost
> all shells do something strange when given continue in the first
> compound-list. E.g. ksh93 does like bash and exits, and zsh breaks
> out of the loop.

It should probably print `test1', and I'll change bash to make it do that.
`continue' just sets a flag saying how many loop levels to break, but
it doesn't get reset if the loop test causes the loop to break.  I imagine
ksh93 does the same thing.  dash and mksh go into an infinite loop.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to