GNU bug report logs - #22909
Manpage test(1): Obsolescent logical operators

Previous Next

Package: coreutils;

Reported by: Martin Gebert <Murphy.Gebert <at> gmx.de>

Date: Fri, 4 Mar 2016 16:33:01 UTC

Severity: normal

Tags: fixed

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22909 in the body.
You can then email your comments to 22909 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 16:33:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Martin Gebert <Murphy.Gebert <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 04 Mar 2016 16:33:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Martin Gebert <Murphy.Gebert <at> gmx.de>
To: bug-coreutils <at> gnu.org
Subject: Manpage test(1): Obsolescent logical operators
Date: Fri, 4 Mar 2016 12:15:51 +0100
The -a and -o operators of test(1) have been marked obsolescent for a 
while now; see link below. However, while the HTML manual is updated, 
the current man page, still my primary source of reference, is missing a 
hint to that:

http://linux.die.net/man/1/test

See also

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 


Martin




Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 16:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Martin Gebert <Murphy.Gebert <at> gmx.de>, 22909 <at> debbugs.gnu.org
Subject: Re: bug#22909: Manpage test(1): Obsolescent logical operators
Date: Fri, 4 Mar 2016 09:41:11 -0700
[Message part 1 (text/plain, inline)]
On 03/04/2016 04:15 AM, Martin Gebert wrote:
> The -a and -o operators of test(1) have been marked obsolescent for a
> while now; see link below. However, while the HTML manual is updated,
> the current man page, still my primary source of reference, is missing a
> hint to that:
> 
> http://linux.die.net/man/1/test

We don't maintain that web page.  You'll have to file your bug report to
the owner of that site.

Meanwhile, you may want to start using man7.org, as a more up-to-date
version of the Linux man pages.

But you are absolutely right that our own '[ --help' (which is the
source for the Coreutils' man page, which in turn feeds those two web
sites) probably should be more vocal that -a and -o should be avoided.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 16:57:02 GMT) Full text and rfc822 format available.

Message #11 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: 22909 <at> debbugs.gnu.org
Subject: [PATCH] test: Document that -a and -o are undesirable
Date: Fri,  4 Mar 2016 09:55:53 -0700
POSIX recommends avoiding -a and -o, for good reason.
src/test.c (usage): Mention that inherent ambiguities exist with
binary -a and -o.
Problem reported by Martin Gebert in: http://bugs.gnu.org/22909
---
 src/test.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/test.c b/src/test.c
index 36817d2..bf31cf9 100644
--- a/src/test.c
+++ b/src/test.c
@@ -790,6 +790,11 @@ INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\
 "), stdout);
       fputs (_("\
 \n\
+NOTE: Use of binary -a and -o create inherently ambiguous situations.  Use\n\
+'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead.\n\
+"), stdout);
+      fputs (_("\
+\n\
 NOTE: [ honors the --help and --version options, but test does not.\n\
 test treats each of those as it treats any other nonempty STRING.\n\
 "), stdout);
-- 
2.5.0





Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 17:14:02 GMT) Full text and rfc822 format available.

Message #14 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Eric Blake <eblake <at> redhat.com>, 22909 <at> debbugs.gnu.org
Subject: Re: bug#22909: [PATCH] test: Document that -a and -o are undesirable
Date: Fri, 4 Mar 2016 09:12:59 -0800
On 04/03/16 08:55, Eric Blake wrote:
> POSIX recommends avoiding -a and -o, for good reason.
> src/test.c (usage): Mention that inherent ambiguities exist with
> binary -a and -o.
> Problem reported by Martin Gebert in: http://bugs.gnu.org/22909
> ---
>   src/test.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/test.c b/src/test.c
> index 36817d2..bf31cf9 100644
> --- a/src/test.c
> +++ b/src/test.c
> @@ -790,6 +790,11 @@ INTEGER may also be -l STRING, which evaluates to the length of STRING.\n\
>   "), stdout);
>         fputs (_("\
>   \n\
> +NOTE: Use of binary -a and -o create inherently ambiguous situations.  Use\n\
> +'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead.\n\
> +"), stdout);
> +      fputs (_("\
> +\n\
>   NOTE: [ honors the --help and --version options, but test does not.\n\
>   test treats each of those as it treats any other nonempty STRING.\n\
>   "), stdout);
>

+1

thanks




Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 17:51:01 GMT) Full text and rfc822 format available.

Message #17 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 22909 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>
Subject: Re: bug#22909: [PATCH] test: Document that -a and -o are undesirable
Date: Fri, 4 Mar 2016 09:50:07 -0800
On Fri, Mar 4, 2016 at 9:12 AM, Pádraig Brady <P <at> draigbrady.com> wrote:
> On 04/03/16 08:55, Eric Blake wrote:
...
>> +NOTE: Use of binary -a and -o create inherently ambiguous situations.

I like that, too. Thanks. One nit: s/create/creates/




Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 17:52:02 GMT) Full text and rfc822 format available.

Message #20 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 22909 <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>
Subject: Re: bug#22909: [PATCH] test: Document that -a and -o are undesirable
Date: Fri, 4 Mar 2016 09:51:15 -0800
On Fri, Mar 4, 2016 at 9:50 AM, Jim Meyering <jim <at> meyering.net> wrote:
> On Fri, Mar 4, 2016 at 9:12 AM, Pádraig Brady <P <at> draigbrady.com> wrote:
>> On 04/03/16 08:55, Eric Blake wrote:
> ...
>>> +NOTE: Use of binary -a and -o create inherently ambiguous situations.
>
> I like that, too. Thanks. One nit: s/create/creates/

Or perhaps better/shorter still:

  Binary -a and -o are inherently ambiguous.




Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Fri, 04 Mar 2016 18:44:01 GMT) Full text and rfc822 format available.

Message #23 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Jim Meyering <jim <at> meyering.net>, Pádraig Brady
 <P <at> draigbrady.com>
Cc: 22909 <at> debbugs.gnu.org
Subject: Re: bug#22909: [PATCH] test: Document that -a and -o are undesirable
Date: Fri, 4 Mar 2016 11:43:05 -0700
[Message part 1 (text/plain, inline)]
On 03/04/2016 10:51 AM, Jim Meyering wrote:
> On Fri, Mar 4, 2016 at 9:50 AM, Jim Meyering <jim <at> meyering.net> wrote:
>> On Fri, Mar 4, 2016 at 9:12 AM, Pádraig Brady <P <at> draigbrady.com> wrote:
>>> On 04/03/16 08:55, Eric Blake wrote:
>> ...
>>>> +NOTE: Use of binary -a and -o create inherently ambiguous situations.
>>
>> I like that, too. Thanks. One nit: s/create/creates/
> 
> Or perhaps better/shorter still:
> 
>   Binary -a and -o are inherently ambiguous.

I like it; I'll push with that wording.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#22909; Package coreutils. (Thu, 25 Oct 2018 16:05:02 GMT) Full text and rfc822 format available.

Message #26 received at 22909 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: 22909 <at> debbugs.gnu.org
Subject: Re: bug#22909: [PATCH] test: Document that -a and -o are undesirable
Date: Thu, 25 Oct 2018 10:04:42 -0600
tags 22909 fixed
close 22909
stop

(triaging old bugs)

On Fri, Mar 04, 2016 at 11:43:05AM -0700, Eric Blake wrote:
> On 03/04/2016 10:51 AM, Jim Meyering wrote:
> > On Fri, Mar 4, 2016 at 9:50 AM, Jim Meyering <jim <at> meyering.net> wrote:
> >> On Fri, Mar 4, 2016 at 9:12 AM, Pádraig Brady <P <at> draigbrady.com> wrote:
> >>> On 04/03/16 08:55, Eric Blake wrote:
> >> ...
> >>>> +NOTE: Use of binary -a and -o create inherently ambiguous situations.
> >>
> 
> I like it; I'll push with that wording.
> 

pushed here:
https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=6475c514550bc1fbdb3410485312211726765798

So closing as "fixed".

-assaf






Added tag(s) fixed. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 22:06:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 22909 <at> debbugs.gnu.org and Martin Gebert <Murphy.Gebert <at> gmx.de> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 22:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Nov 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 153 days ago.

Previous Next


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