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

Bart Schaefer <[email protected]> Sun, 26 Jul 2026 22:15:51 -0700
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <CAH+w=7b7mFyn6jBBkOQoFeCn_8p6zZTCjMRs+-+ZDoR5Ke9jMA@mail.gmail.com>
On Thu, Jul 23, 2026 at 7:42=E2=80=AFAM Philippe Altherr
<[email protected]> wrote:
>
> Below is a patch that changes Zsh's emulation of ksh to map ksh's ! to ju=
st (k) instead of (!k). Note that the flag combination (!k) is forbidden, w=
hich I think is right.

This doesn't look right to me?  The test is prefixed with

  .k02.array=3D(characters in an array)

${!.k02.ref} should not return "characters" ...?  That makes '!' just
a no-op for this case.

--- expected
+++ actual
@@ -1,3 +1,3 @@
+characters
 .k02.array
-.k02.array
 characters
Test K02parameter.ztst failed: output differs from expected as shown above =
for:
  () {
    typeset -n .k02.ref=3D.k02.array
    emulate -L ksh
    print -l ${!.k02.ref} ${(!).k02.ref} ${.k02.ref}
  }
Was testing: namerefs with namespaces
K02parameter.ztst: test failed.