Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Combining control structures z/OS UNIX System Services User's Guide SA23-2279-00 |
|
You can combine control structures by nesting (that is, putting
one inside another). For example:
This shell script takes one positional parameter, giving
the name of a file. The script looks in the working directory and
finds the names of all .c files. The if control
structure inside the foreach loop tests each file to see
if it is older than the file named on the command line. If the .c file is older, echo displays the name,
and the file is compiled. You can think of this as making a set of
files up to date with the file name specified on the command line. |
Copyright IBM Corporation 1990, 2014
|