On 3/28/22 3:06 PM, Martin Schulte wrote:
Hello,

on Mon, 28 Mar 2022 20:34:40 +0200 Alex fxmbsw7 Ratchev <fxmb...@gmail.com> 
wrote:
https://pastebin.com/raw/T7ZnFapt

about inconsitency, about chets 'uh no bugs'

ive experienced this and such x times already ( got better, this is not my
code )

Here's a somewhat stripped down version:

$ bash --noprofile --norc -i -c "echo \$BASH_VERSION; shopt -s expand_aliases ; source <(echo 
\"alias x='echo hallo'\"); alias; x"
5.1.4(1)-release
alias x='echo hallo'
bash: x: command not found

OK, once more from the top.

The argument to -c is a single command. Bash always reads a complete command before executing any of it. The argument string is parsed into a
compound command: a compound list. Since the entire compound list is parsed
before executing any of the commands it contains, the `x' is parsed as a
simple command with no defined alias -- the parsing takes place before
executing the `alias x=...' command.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Reply via email to