Conditionals in BASH

Matthew Saltzman mjs at clemson.edu
Wed Apr 9 18:29:53 UTC 2008


The conditionals && and || in bash are short-circuit, so that once a
term is evaluated that determines the success or failure of the entire
expression, evaluation of the remaining alternatives is skipped.

In a test expression (enclosed in [ ... ]), are the conditionals -a and
-o also short-circuit?  The O'Reilly BASH book seems to suggest that
they are not, but the description seems to me to be ambiguous.

TIA.
-- 
                Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs




More information about the users mailing list