MFC rev. 1.24-1.25:

test(1) doesn't do shortcut evaluation in its logical operators.
This commit is contained in:
yar 2006-08-01 09:53:53 +00:00
parent 333f9ded5a
commit a922641164

View File

@ -32,7 +32,7 @@
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd July 3, 2004
.Dd July 31, 2006
.Dt TEST 1
.Os
.Sh NAME
@ -332,3 +332,16 @@ The
utility implements a superset of the
.St -p1003.2
specification.
.Sh BUGS
Both sides are always evaluated in
.Fl a
and
.Fl o ,
unlike in the logical operators of
.Xr sh 1 .
For instance, the writable status of
.Pa 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:
.Pp
.Dl "[ -z abc -a -w file ]"