Re: Zsh's and ksh's bang (!) expansion flags have different meanings

Philippe Altherr <[email protected]> Sun, 19 Jul 2026 19:24:24 +0200
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAGdYchsKwb=Rpx9Rgv0yACZvjbFHSFjq-QmLY701UeCY9=PRzA@mail.gmail.com>
--00000000000056fcb00656fa10c7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Jul 19, 2026 at 6:36=E2=80=AFPM Bart Schaefer <schaefer@brasslanter=
n.com>
wrote:

> You're not noticing anything new, or rather the only thing new that you'r=
e
> noticing is that the (!) flag exists at all.  Zsh never had (!) until I
> started working on named references, because using ! for anything other
> than history was a problem in interactive shells (still is).
>

I'm fully aware that the (!) flag is a part of named references, so not
already present in any released version of Zsh. Since many aspects of named
references seem to be modelled on ksh's named references, I was a little
surprised to discover that the (!) flag differs so much in the two shells.
As already mentioned, I personally think it's perfectly fine. I suspect
that this difference isn't obvious to everyone interested in named
references. I thought it was worthwhile to point it out now, while things
can still be changed, just in case anyone has a strong objection to it.

Philippe

--00000000000056fcb00656fa10c7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><span style=3D"background-color:transpare=
nt">On Sun, Jul 19, 2026 at 6:36=E2=80=AFPM Bart Schaefer &lt;<a href=3D"ma=
ilto:[email protected]">[email protected]</a>&gt; wrote:</s=
pan></div><div class=3D"gmail_quote gmail_quote_container"><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid r=
gb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quot=
e"><div>You&#39;re not noticing anything new, or rather the only thing new =
that you&#39;re noticing is that the (!) flag exists at all.=C2=A0 Zsh neve=
r had (!) until I started working on named references, because using ! for =
anything other than history was a problem in interactive shells (still is).=
=C2=A0</div></div></div></blockquote><div><br></div><div>I&#39;m fully awar=
e that the (!) flag is a part of named references, so not already present i=
n any released version of Zsh. Since many aspects of named references seem =
to be modelled on ksh&#39;s named references, I was a little surprised=C2=
=A0to discover that the=C2=A0(!) flag differs so much in the two shells. As=
 already=C2=A0mentioned, I personally think it&#39;s perfectly fine. I susp=
ect that this difference isn&#39;t obvious to everyone interested=C2=A0in n=
amed references. I thought it was worthwhile to point it out now, while thi=
ngs can still be changed, just in case anyone has a strong objection to it.=
</div><div><br></div><div>Philippe</div><div><br></div></div></div>

--00000000000056fcb00656fa10c7--