From: Vincent Lefevre <vincent@vinc17.net>
To: 69939@debbugs.gnu.org
Subject: bug#69939: test utility bug: "test -a -a -a" and "test -o -o -o" fail
Date: Fri, 22 Mar 2024 12:20:25 +0100 [thread overview]
Message-ID: <20240322112025.GA316073@cventin.lip.ens-lyon.fr> (raw)
With GNU Coreutils 9.4, both "test -a -a -a" and "test -o -o -o" fail:
$ export POSIXLY_CORRECT=1
$ /usr/bin/test -a -a -a ; echo $?
/usr/bin/test: ‘-a’: unary operator expected
2
$ /usr/bin/test -o -o -o ; echo $?
/usr/bin/test: ‘-o’: unary operator expected
2
According to POSIX, they should return 0.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
says for 3 arguments:
If $2 is a binary primary, perform the binary test of $1 and $3.
Here, $2 is -a and -o respectively, which are binary primaries.
And both $1 and $3 are non-null strings.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
next reply other threads:[~2024-03-22 12:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-22 11:20 Vincent Lefevre [this message]
2024-03-22 16:45 ` bug#69939: test utility bug: "test -a -a -a" and "test -o -o -o" fail Pádraig Brady
2024-03-22 17:24 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240322112025.GA316073@cventin.lip.ens-lyon.fr \
--to=vincent@vinc17.net \
--cc=69939@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).