DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing Deskshell commands

Conditionals

The ``&&'' separator executes a command only if the previous command returned a ``true'' status.

The ``||'' separator executes a command only if the previous command returned a ``false'' status. Thus:

This example: Can also be written:
a || b if a; else b; fi
a && b if a; then b; fi
a && b || c if if a; then b; fi else c; fi
After any of the separators ``&'', ``|'', ``||'', or ``&&'', a newline is ignored. Thus the last example above can be written:

   a &&
   b ||
   c
The operators ``|'', ``&'', ``;'', ``::'', ``&&'', and ``||'' can also be preceded or followed by spaces and tabs.

See also:



Next topic: Control constructs
Previous topic: List mark

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005