bash script: command not found
This question already has an answer here:
As the others said you need to capture the output from the commands.
z=echo foo -bash: foo: command not found
is not the same as
z=$(echo foo)
In the first one it's equivalent to
z=echo foo
which is not valid as it thinks foo
is a command.
z=$(echo foo)
however means to execute echo foo
and capture the output into z
.
All of your commands fail to do this.
链接地址: http://www.djcxy.com/p/57218.html下一篇: bash脚本:找不到命令