bash:无法在同一行中设置和使用别名 [英] bash: unable to set and use alias in the same line
本文介绍了bash:无法在同一行中设置和使用别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望第二行说的是foo
而不是command not found
:
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
$
为什么第二行不说foo
?经过以下外壳测试,行为相同:
Why won't the second line say foo
? Tested with the following shells, same behavior:
- bash 3.2.5
- zsh 5.0.8
- 破折号0.5.9
- busybox 1.25.0
推荐答案
查看全文