Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: behavior of test true -a \( ! -a \)
- X-seq: zsh-workers 52814
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: behavior of test true -a \( ! -a \)
- Date: Mon, 25 Mar 2024 18:33:33 +0100
- Archived-at: <https://zsh.org/workers/52814>
- In-reply-to: <CAH+w=7YmaSdFi90g8HQ40AmVAWNRAsy5YuOsBaqSGriCsFosDA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- References: <20240321100710.GA164665@qaa.vinc17.org> <CAH+w=7a+P6d_D3BxiO7hqPji9LbduYcu53ZFOSbg8DkL4QK8og@mail.gmail.com> <CAH+w=7bAB+cx-f_qBMKoec=Hdyj_s_pRUeiE8K8wyr_ig1rDeQ@mail.gmail.com> <20240323222036.GE164665@qaa.vinc17.org> <CAH+w=7Y5isnk+tCFWkjhw7e7d9Q7X_zeMqtOHps9SfX3zvsBJg@mail.gmail.com> <20240325102354.GA617604@cventin.lip.ens-lyon.fr> <CAH+w=7YmaSdFi90g8HQ40AmVAWNRAsy5YuOsBaqSGriCsFosDA@mail.gmail.com>
On 2024-03-25 08:21:53 -0700, Bart Schaefer wrote:
> On Mon, Mar 25, 2024 at 3:24 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> > 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.
Well, "test" with its ambiguities between strings and operators should
have never existed 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.
Dropped from the standard, but not from existing scripts.
> > 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 \) \)
> ??
With zsh, this is consistent:
cventin% test \( ! -a \) \) ; echo $?
0
cventin% test true -a \( ! -a \) \) ; echo $?
0
The other implementations see consistent too.
--
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