Bash error after opening Terminal and running shell scripts (CentOS) [duplicate]

末鹿安然 提交于 2019-12-11 07:48:34

问题


Every time I open Terminal in CentOS 6.4, I get the error:

bash: usr/local/bin: No such file or directory

I've checked .bashrc and .bash_profile to see if there are any lines that reference usr/local/bin, but haven't found anything. The same error also appears when I switch to root, or run a shell script.

Is it as simple as adding a backslash in front of usr? Like so--

/usr/local/bin

Still don't know where the error is happening though. Any help is much appreciated. Thanks!


回答1:


This is strange as the normal bash directory on a centos 6.4 system is /bin/bash, however I would advise you to check the following:

echo $SHELL

It should pull your SHELL environment variable to show you where what shell you are using, normally it looks like this:

SHELL=/bin/bash

If it's different say for example:

SHELL=usr/local/bin/bash

then I would check your passwd file to make sure your users default shell is pointing to the right place.

username:x:601:601::/home/username:/bin/bash

Also I would suggest check where you shell actually lives

which bash
/bin/bash

And make sure everything is pointing to the correct location.



来源:https://stackoverflow.com/questions/19434728/bash-error-after-opening-terminal-and-running-shell-scripts-centos

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!