Re: Having an alias and a function with the same name leads to some sort of recursion

2023-02-07 Thread Robert Elz
Date:Tue, 7 Feb 2023 14:35:54 -0500 From:Chet Ramey Message-ID: | On 2/7/23 12:33 PM, Dale R. Worley wrote: (That was 7 Feb, not 2 July...) | > That makes it clear why the second case behaves as it does. But my | > reading of the definition of "simple command

Re: Having an alias and a function with the same name leads to some sort of recursion

2023-02-07 Thread Chet Ramey
On 2/7/23 12:33 PM, Dale R. Worley wrote: ALIASES Aliases allow a string to be substituted for a word when it is used as the first word of a simple command. That makes it clear why the second case behaves as it does. But my reading of the definition of "simple commands" i

Re: Having an alias and a function with the same name leads to some sort of recursion

2023-02-07 Thread Dale R. Worley
Robert Elz writes: > | Aliases are not used in bash scripts, unless bash is invoked in POSIX > | compatibility mode, or the "expand_aliases" shopt is turned on. > > I think that's what must have happened ... the infinite loop of > echo commands suggests that the function definition > > c

[PATCH] use bind_lastarg to restore $_ when executing variable

2023-02-07 Thread Emanuele Torre
Before this patch, if allexport was set, $_ gained the "x" attribute after PROMPT_COMMAND finished running, that would only get removed after the next simple command is executed. $ PROMPT_COMMAND=: $ : foo $ declare -p _ declare -- _="foo" $ set -a $ : bar $ declare -p _ declare -x