>>>>> "EB" == Eric Blake <ebl...@redhat.com> writes:

EB> On 12/21/2015 05:00 PM, 積丹尼 Dan Jacobson wrote:
>> OK. Also make sure (info "(coreutils) test invocation") makes it clear that
>> one cannot use
>> test -f $1 -a $1 ! -ot $2 #and must use
>> test -f $1 -a ! $1 -ot $2 #.

EB> Use of -a in test is inherently non-portable.  POSIX even says so -
EB> there are some expressions which are completely ambiguous when you
EB> attempt to use -a or -o.

Mmmm! The documentation should mention that!

EB> Also, your lack of quoting is a classic pitfall for how to incorrectly
EB> use test.

EB> Better than what you typed would be using:

EB> test -f "$1" && test ! "$1" -ot "$2"

Mmmm, quote tips only mention in the case of (info "(coreutils) String tests").
Maybe need to mention in more places!

Also no "X$1" = X special tip seen...



Reply via email to