[Top][All Lists]

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

Re: Incorrect alias expansion within command substitution

From: Alex fxmbsw7 Ratchev
Subject: Re: Incorrect alias expansion within command substitution
Date: Tue, 1 Feb 2022 19:16:35 +0100

On Tue, Feb 1, 2022, 19:11 Chet Ramey <chet.ramey@case.edu> wrote:

> On 2/1/22 10:23 AM, Chet Ramey wrote:
> > If you defer alias expansion until execution, you lose the (posix-
> > encouraged but officially unspecified according to the approved
> > interpretation of issue 1342) ability to have aliases affect command
> > parsing in the command substitution:
> Well, I went back and read the entire interpretation. The part that's not
> specified is whether an alias expansion provides the closing `)', but alias
> expansion has to be performed while parsing the contents of the command
> substitution:
> "existing aliases are required to be expanded when the shell parses the
> input that follows the "$(" in order to find the terminating ')'"

i see here only possible ) closing parsing, not doing so results in a mess

for me, aliases as im bash ive experienced as text inplace replacements,
flat text, then the cmdline parsing is done, so closing ) if easily
specified by user yes works, else broken incomplete ( wrong pathed ) aliases

> and (in the same interpretation):
> "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)."
> So this seems like behavior that should be conditional on posix mode to
> preserve backwards compatibility.
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

reply via email to

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