bug-bash
[Top][All Lists]
Advanced

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

Re: extension of file-test primitives?


From: DJ Mills
Subject: Re: extension of file-test primitives?
Date: Wed, 23 Aug 2017 16:11:17 -0400

On Wed, Aug 23, 2017 at 3:57 PM, Eric Blake <eblake@redhat.com> wrote:

>
> Not just deprecated, but inherently ambiguous.  There are situations
> where you CANNOT tell whether the user meant -a to mean the binary
> operator or a string being tested against, because POSIX (intentionally)
> does not specify enough precedence rules in how to parse > 4 arguments.
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>
>
What would you expect [ ! -a foo ] to do?

It's always true, because it treats -a as the logical AND there. And that's
with 3 arguments, which is defined but unexpected behavior


reply via email to

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