z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Using && and ||

z/OS UNIX System Services User's Guide
SA23-2279-00

When stringing together more than two commands, you may want to control the running of the second command based on the outcome of the first command. You can use:
&&
If the command that precedes && completes successfully, the command following && is run. Leave a space on either side of the && operator: command && command.
||
If the command that precedes || fails, the command following || is run. Leave a space on either side of the || operator: command || command.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014