The
test
grammar is inherently ambiguous.
In order to assure a degree of consistency,
the cases described in the
-p1003.2,
section D11.2/4.62.4, standard
are evaluated consistently according to the rules specified in the
standards document.
All other cases are subject to the ambiguity in the
command semantics.

In particular, only expressions containing
-a ,
-o ,
(
or
)
can be ambiguous.

Both sides are always evaluated in
-a
and
-o .
For instance, the writable status of
file
will be tested by the following command even though the former expression
indicated false, which results in a gratuitous access to the file system: