Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: what can be global aliases used for?



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




Messages sorted by: Reverse Date, Date, Thread, Author