BREAK(1SH) COMMAND REFERENCE BREAK(1SH)
NAME
break - exit from a for or while loop (sh built-in)
SYNOPSIS
break [ n ]
DESCRIPTION
Break exits from the enclosing for or while loop. If n is
specified, break n levels.
EXAMPLES
The following shell script reads lines from the standard
input. If the first word is "end", the rest of the line is
printed and the shell script terminates. The loop is left by
using break.
#!/bin/sh
while read f g
do
if test "$f" = "end"
then
break
fi
done
echo $g
RETURN VALUE
[NO_ERRS] Command completed without error.
SEE ALSO
break(1csh), cd(1sh), continue(1sh), csh(1csh), echo(1sh),
eval(1sh), exec(1sh), exit(1sh), export(1sh), hash(1sh),
login(1), pwd(1sh), read(1sh), readonly(1sh), return(1sh),
set(1sh), sh(1sh), shift(1sh), test(1sh), times(1sh),
trap(1sh), type(1sh), ulimit(1sh), umask(1sh), unset(1sh),
wait(1sh), execve(2).
Printed 10/17/86 1
%%index%%
na:72,139;
sy:211,107;
de:318,257;
ex:575,499;
rv:1074,133;
se:1207,809;
%%index%%000000000106