bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34475: Mention even more worries for test -a


From: 積丹尼 Dan Jacobson
Subject: bug#34475: Mention even more worries for test -a
Date: Thu, 14 Feb 2019 09:00:05 +0800

First, on the test(1) man page, at


       EXPRESSION1 -a EXPRESSION2
              both EXPRESSION1 and EXPRESSION2 are true

       EXPRESSION1 -o EXPRESSION2
              either EXPRESSION1 or EXPRESSION2 is true


Say instead

       EXPRESSION1 -a EXPRESSION2
              both EXPRESSION1 and EXPRESSION2 are true (See warning NOTE 
below.)

       EXPRESSION1 -o EXPRESSION2
              either EXPRESSION1 or EXPRESSION2 is true (See warning NOTE 
below.)

else users who never make it down to the "fine print at bottom" will
blithefully use them a lifetime without ever an inkling of the dangers!

(Indeed on (info "(coreutils) Connectives for test")
you discuss the dangers first, before even letting the users eyeballs
touch the syntax!)

Also on both man and info pages you need to warn of portability worries,
e.g., in bash we see -a and -o do even more things.

$ help test|egrep -- ' -(a|o) '
      -a FILE        True if file exists.
      -o OPTION      True if the shell option OPTION is enabled.
      EXPR1 -a EXPR2 True if both expr1 AND expr2 are true.
      EXPR1 -o EXPR2 True if either expr1 OR expr2 is true.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]