且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

得到“找不到命令". bash脚本中的错误

更新时间:2022-12-10 10:25:24

问题是,如果调用时未使用完整路径,则您将重新定义PATH变量,bash将在其中查找二进制文件.

The problem is that you are redefining the PATH variable where bash looks into to find the binary files if you don't use a complete path when calling.

您应该将bash脚本中的PATH更改为MYPATH或类似的名称,以免与已经存在的环境变量混淆.

You should change the PATH in your bash script to MYPATH or something like that, so that it doesn't mess with the already environmental variables.

如果您不知道PATH变量是什么,可以查看***的文章

If you don't know what the PATH variable is for you can look at wikipedia's article