Path: 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 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