|
|
The following sections contain models of the shell programming constructs.
command <<! input lines !
for variable in this list of values do command 1 command 2 . . . last command done
while command list do command 1 command 2 . . . last command done
if this command list is successful then command 1 command 2 . . . last command fi
if this command list is successful then command 1 command 2 . . . last command else command 1 command 2 . . . last command fi
case word in pattern1) command 1 . . . last command ;; pattern2) command 1 . . . last command ;; . . . last pattern2) command 1 . . . last command ;; esac
A break or continue statement forces the program to leave any loop and execute the command following the end of the loop.