Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: behavior of test true -a \( ! -a \)



On Mon, Mar 25, 2024 at 3:24 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> On 2024-03-23 15:41:33 -0700, Bart Schaefer wrote:
> > On Sat, Mar 23, 2024 at 3:20 PM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > >
> > > On 2024-03-23 14:48:36 -0700, Bart Schaefer wrote:
> > > > I'd therefore argue that it's actually
> > > >
> > > > % test \( ! -a \)
> > > >
> > > > that is wrong
> > >
> > > POSIX specifies what happens with up to 4 arguments.
> >
> > Ok, but
> >
> > % test \( ! -a \) \)
> >
> > has five [...]
>
> I meant that
>
>   test \( ! -a \)
>
> has four, thus fully specified and not wrong.

And I meant (in the follow-up, being unaware of the exact spec at
first) that I think it was wrong to specify it that way in the first
place.

I suspect that we're re-hashing an argument that's already been had on
austin-group and led to these constructs being first declared obsolete
and soon dropped.

> Concerning
>
>   test true -a \( ! -a \)
>
> I would say that if you decide that the first "-a" is an "and",
> then after this "-a", there remain exactly 4 arguments, so that
> for *consistency*, I think that the remaining 4 arguments should
> be interpreted exactly as in
>
>   test \( ! -a \)

So what about
  test true -a \( ! -a \) \)
??

Counting arguments just doesn't work.




Messages sorted by: Reverse Date, Date, Thread, Author