我有一个叫屠夫文件,并在该文件的顶部,我把#!/斌/ bash的。在我改变权限,像这样搭配chmod 777屠夫。但是当我尝试运行通过键入屠夫剧本,我得到这个错误:-bash:屠夫:命令未找到。我不知道如何解决它,请帮忙!先谢谢你! :D
I have a file called butcher and at the top of this file I put #!/bin/bash. The I changed permissions like so chmod 777 butcher. however when I try to run the script by typing butcher, I get this error: -bash: butcher: command not found. I'm not sure how to fix it, please help! Thank you in advance! :D
推荐答案该文件将不得不在你的$ PATH为您的系统找到它,执行它。否则,该文件的整个路径必须被指定。
The file would have to be on your $PATH for your system to find it and execute it. Otherwise, the entire path to the file would have to be specified.
要显示你的路径尝试:
echo $PATH屠夫位于
要运行脚本,无论是把它放在这些位置之一(例如/ usr / local / bin中),或转到该目录,运行 ./屠夫。
更多推荐
我如何在Cygwin中运行的bash shell脚本?
发布评论