Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh's and ksh's bang (!) expansion flags have different meanings
- X-seq: zsh-workers 54995
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Philippe Altherr <philippe.altherr@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Zsh's and ksh's bang (!) expansion flags have different meanings
- Date: Sun, 19 Jul 2026 10:48:44 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=K/X8+jFpySpQ3rWcbxwQOguZKqtuJafLxGwN731G5cQ=; fh=RngAOd9wlRc8Glv1v2GOfDUnq2FsyrczungEY8JNfXY=; b=MxaFaj29s0vtOVvkU8SPHpn185w/rVxb/ToHhEe2F2U+sj7zQwGRQ+Yiar33p0yq5s ioogjzR2xCYgUsBMc2ZnUwh5b4WR/ZGHeWYD2/7IZubfBASGf86VWHTHtJLJuwSSmQYu ZQYAUZHHa0KlA7RtwoDF3lseCoPJiHL3v0kBsWkusw4yGjbvf0qJjPR0lwiS5L2I5aWq q4YVztUaZWTTEVTpAj72Pnt6+NmeFi1HnTHr6hniWbc8w5ap0vht0Ne6bB4wO0dkUoe9 Nfzw++QlkGfZRT86BN45Cqpli5cVQGkLEdO4X/jvUNashFdXi9Q7CjD1CLd/55pV6YEl yZgg==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1784483336; cv=none; d=google.com; s=arc-20260327; b=NOPes39bGDo4839/wgJkHwe7ld9/K/4NgrfQdnFVPbNhVlQFc2vH9KM5kU0iX7wNIV Z/LrqYO4KtRx8FrGghbLNAm/QJZenddvQ0c3HSvl/8nW27ntn+gsphk8s+riXm6IWleL qXVEgJTOX5X92LmpJHCPsxFLv93ScBDWH4DM1V/WIdG2SshM72E2qUqK/UnePY/CEaOG 8jt4O9BDNKxCloEtcfqx83kRrxDTTObNdT7my5/TfO+JgRUFw8yyoI8SjYfB7Js0Ub/2 kjjvAtv3mcu4TfoYEvW4JAU2Ma7Iop5J3FChS9rRqJ57T+RL5D5UhKnKi4CGDrFkOmFX bIoQ==
- Archived-at: <https://zsh.org/workers/54995>
- In-reply-to: <CAGdYchsKwb=Rpx9Rgv0yACZvjbFHSFjq-QmLY701UeCY9=PRzA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGdYchvRE_B4b0yuk9drdR3dKb-2ci5r9PC5mUsVQ=x8tm2-1g@mail.gmail.com> <CAH+w=7Zd1Ov6XHYom1Ybs5oSujPyUTzX4213dMP968L53O7WEw@mail.gmail.com> <CAGdYchsKwb=Rpx9Rgv0yACZvjbFHSFjq-QmLY701UeCY9=PRzA@mail.gmail.com>
On Sun, Jul 19, 2026 at 10:24 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> On Sun, Jul 19, 2026 at 6:36 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>
>> You're not noticing anything new, or rather the only thing new that you're noticing is that the (!) flag exists at all.
>
> I'm fully aware that the (!) flag is a part of named references, so not already present in any released version of Zsh.
Well, yes. The (sorry, unstated) point was that everything you said
about (k) is long-standing and (hopefully?) derivable from
documentation or FAQ.
However, if someone wants to convert those tables of differences into
a format that could be included in either the FAQ or the "Other
Differences" section of the zsh/ksh93 module documentation, it would
probably be quite useful.
>>> In ksh, the (!) flag can be used to list the keys of arrays and associative arrays. In that regard, it's closer to Zsh's (k) flag than Zsh's (!) flag
The (k) flag was originally intended to mimic ksh's ! name prefix (due
to ! colliding with history). The character "k" was chosen as a
mnemonic for "like (k)sh". I suppose, rather than introduce (!), I
could have extended (k) for the named reference behavior, to preserve
that similarity. Could still try that if it seems a good idea.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author