Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: behavior of test true -a \( ! -a \)
- X-seq: zsh-workers 52811
- From: Vincent Lefevre <vincent@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: behavior of test true -a \( ! -a \)
- Date: Mon, 25 Mar 2024 11:23:54 +0100
- Archived-at: <https://zsh.org/workers/52811>
- In-reply-to: <CAH+w=7Y5isnk+tCFWkjhw7e7d9Q7X_zeMqtOHps9SfX3zvsBJg@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>
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