Article View: gnu.bash.bug
Article #120break doesnt
From: William G. Bunton
Date: Thu, 15 Jun 1989 12:30
Date: Thu, 15 Jun 1989 12:30
29 lines
973 bytes
973 bytes
Given the following script:
--------------
while true
do
break
echo "Still in while"
shift
done
echo "Out of while"
-------------
When run by bash the following output is produced:
Still in while
Out of while
When run by bin/sh the following is produced:
Out of while
It appears the break command just sets a flag, which is only checked
each time the while condition is checked. Then every command in the
do--done part is executed.
Bill
--
William G. Bunton wgb@tntdev.tnt.com {uunet,natinst}!tntdev!wgb
Tools & Techniques, Inc. Austin, TX
Technical Details
Message-ID:
<8906151230.AA09891@tntdev.tnt.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!tntdev.tnt.com!wgbShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!tntdev.tnt.com!wgb From: wgb@tntdev.tnt.com (William G. Bunton) Newsgroups: gnu.bash.bug Subject: break doesnt Message-ID: <8906151230.AA09891@tntdev.tnt.COM> Date: 15 Jun 89 12:30:12 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 29