From: "Lawrence Velázquez" <larryv@zsh.org>
To: "Sebastian Gniazdowski" <sgniazdowski@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: what can be global aliases used for?
Date: Fri, 17 Feb 2023 16:11:47 -0500 [thread overview]
Message-ID: <a70309b8-eb71-4e38-ad20-12bbcd4c87c3@app.fastmail.com> (raw)
In-Reply-To: <CAKc7PVAX3oJdrJDiqjxsLMH5+DaYt09dwzqA01ZBEY3rWwd_5A@mail.gmail.com>
On Fri, Feb 17, 2023, at 9:54 AM, Sebastian Gniazdowski wrote:
> I wonder what else can global aliases do?
An esoteric but amusing example:
1) Autoconf uses ${1+"$@"} instead of "$@" to work around a bug
in pre-SVR3 Bourne shells.
2) This doesn't work properly in pre-4.3 zsh because SH_WORD_SPLIT
splits ${1+"$@"} too aggressively.
3) But zsh doesn't have a problem with "$@" in the first place,
so Autoconf defines a global alias that dynamically replaces
${1+"$@"} with "$@", undoing the original workaround.
https://www.gnu.org/software/autoconf/manual/autoconf-2.71/html_node/Shell-Substitutions.html#index-_0022_0024_0040_0022
--
vq
next prev parent reply other threads:[~2023-02-17 21:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAKc7PVA0X1786JP7g69aDP8eL+1oAZpipVC-4BNm1KV=OPxe7A@mail.gmail.com>
2023-02-17 14:54 ` Sebastian Gniazdowski
2023-02-17 17:15 ` Roman Perepelitsa
2023-02-17 19:10 ` Bart Schaefer
2023-02-17 21:11 ` Lawrence Velázquez [this message]
2023-02-17 21:19 ` Roman Perepelitsa
2023-02-17 23:27 ` Lawrence Velázquez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a70309b8-eb71-4e38-ad20-12bbcd4c87c3@app.fastmail.com \
--to=larryv@zsh.org \
--cc=sgniazdowski@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).