Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


Appendix C (continued)

Command Terminators

||  If not successful, do …

When placed between two commands, the || operator executes the first command and executes the second only if the first is not successful. For example, the command

Find /happiness/ || Echo Sorry!

searches for the string happiness in a file and, if it does not find it, displays

Sorry!

in the active window.

&&  If successful, do …

When placed between two commands, the && operator terminates the first command and if the first command is successful, executes the second command. For example, the command

Find /happiness/ && Echo Hooray!

searches for the string happiness in a file and, if it finds the string, prints the word

Hooray!

;  Join commands on one line

The ; character joins commands on one line. Instead of writing

beep
beep
beep

you could write

beep ; beep ; beep

The MPW Shell handles both sets of commands in the same way. You do not need to type the ; character after the last command on the line. You would terminate the last command as usual by pressing Enter.

 
 


Last Updated July 2000