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

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



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 and
> 
> % test \( ! -a \) -a true
> 
> has six, and in neither case are the "first four" interpreted as you
> would have the "last four" interpreted in
> 
> % test true -a \( ! -a \)

I meant that

  test \( ! -a \)

has four, thus fully specified and not wrong.

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 \)

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - 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)




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