PATH变量“没有这样的文件或目录”:终端显示当我开始我的终端,我得到这个消息在启动时
bash: cd: PATH=/Users/ryan/Users/ryan/Documents/Pebble-Dev/PebbleSDK-2.0-BETA3/bin:/Users/ryan/pebble-dev/PebbleSDK-2.0-BETA4/bin:/Users/ryan/.rvm/gems/ruby-2.0.0-head/bin:/Users/ryan/.rvm/gems/[email protected]/bin:/Users/ryan/.rvm/rubies/ruby-2.0.0-head/bin:/Users/ryan/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin: No such file or directory
我知道有多重PebbleSDKs,第一个的路径肯定是不对的。找不到从哪里撤出。
而且,当我键入echo $PATH
到终端,我得到:
/Users/ryan/pebble-dev/PebbleSDK-2.0-BETA4/bin:/Users/ryan/pebble-dev/PebbleSDK-2.0-BETA4/bin:/Users/ryan/pebble-dev/PebbleSDK-2.0-BETA4/bin:/Users/ryan/Documents/Pebble-Dev/PebbleSDK-2.0-BETA3/bin:/Users/ryan/pebble-dev/PebbleSDK-2.0-BETA4/bin:/Users/ryan/.rvm/gems/ruby-2.0.0-head/bin:/Users/ryan/.rvm/gems/[email protected]/bin:/Users/ryan/.rvm/rubies/ruby-2.0.0-head/bin:/Users/ryan/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
这也是不对的,因为它有更多个 PebbleSDKs在里面。
我有三个问题: 1)初始PATH从哪里被拉出? 2)echo $PATH
从哪里拉? 3他们为什么不同?
谢谢!
更新1:
这是我在/etc/bashrc
:
# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi
这是我在/etc/profile
:
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
将在什么地方.bashrc
,.bash_profile
,和.profile
您提到的文件位于?
真正的问题是,在你的配置文件中,你是否试图将作业传递给'PATH'作为'cd'的参数? – chepner
我不知道...不是我的机器发生这种情况。我可以从哪里开始寻找? – ryanpitts1
'.bashrc','.bash_profile'和'.profile'是很好的开始。系统文件不太可能,但可能是'/ etc/profile'和'/ etc/bashrc'。 – chepner