bug-coreutils
[Top][All Lists]
Advanced

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

Re: bug with 'test'


From: The Wanderer
Subject: Re: bug with 'test'
Date: Thu, 08 Dec 2005 22:06:19 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922

Adam Chou wrote:

test -v, test --version, test -h, and test --help do not work. they
just return me to the command line. i have tried GNU sh-utils 2.0,
coreutils 5.2.1 and coreutils 5.0. i wasn't aware of a newer version
out to try. other people on irc have confirmed that their versions
also fail to output anything. i also specified the full path by doing
/usr/bin/test but got the same results.

Since I happened to have the source sitting around, I took a look, and
apparently this is intentional for the binary named 'test'. The binary
named '[' will react correctly to both of those options if no ']'
argument is provided, but according to the source, 'test' is required by
POSIX to respond to either of those options by exiting silently with
status 1.

This would appear to me to be a bug in the documentation, in that the
man pages for 'test' and '[' are identical (actually, on my system, the
latter is a symlink to the former) but their behaviour differs. I'm
not sure how best to fix it.

(Hmm. A possible unintended behaviour in 5.93: '[ ] --help', rather than
exiting silently or printing the usage message, reports "missing ']'".)

--
      The Wanderer takes a step out onto yet another limb

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.




reply via email to

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