I would expect the second line to say foo
instead of command not found
:
$ alias foo="echo bac" ; foo;
-bash: foo: command not found
$ foo
bac
$
Why won't the second line say foo
? Tested with the following shells, same behavior:
- bash 3.2.5
- zsh 5.0.8
- dash 0.5.9
- busybox 1.25.0
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…