[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incorrect alias expansion within command substitution

From: L A Walsh
Subject: Re: Incorrect alias expansion within command substitution
Date: Wed, 02 Feb 2022 08:14:20 -0800
User-agent: Thunderbird

On 2022/02/01 07:50, Chet Ramey wrote:

"Historically some shells used simple parenthesis counting to find the
terminating ')' and therefore did not account for aliases. However, such
shells never conformed to POSIX, which has always required recursive
parsing (see XCU 2.3 item 5)."
   It doesn't require recursive parsing if the aliases declared
in the parent shell are expanded in the child shell -- i.e. if
bash followed the posix requirement that alias expansion default to
on, then the aliases in the BASH_ALIASES data structure would
automatically be imported into the child shell and expanded and this
type of complicated parsing problem wouldn't occur.  It seems
like the reason this error is occurring, is because someone is trying to
work around bash's incompatibility with the posix standard by not starting
with aliases turned on by default.

So this seems like behavior that should be conditional on posix mode to
preserve backwards compatibility.
You mean continue to to create workaround(s) for bash's non-conformance
w/r/to initial alias expansion.

Why not nip the problem at the source -- make bash posix conformant by starting
w/alias expansion turned on?

In the long run it will prove simpler and provide
compatibility with existing posix-compliant shells.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]