🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by William G. Bunton Thu, 15 Jun 1989 12:30
break doesnt
#120
Author: William G. Bunton
Date: Thu, 15 Jun 1989 12:30
29 lines
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        
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads