GNU bug report logs - #34475
doc: test: expand on -a/-o usage

Previous Next

Package: coreutils;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Thu, 14 Feb 2019 03:38:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
To: 34475 <at> debbugs.gnu.org
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.




This bug report was last modified 6 years and 121 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.