当我启动终端时,我收到此消息:
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/ruby-2.0.0-head@global/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
我意识到有多个PebbleSDK,第一个路径肯定是错误的。无法找到从中获取的地方。
此外,当我在终端中输入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/ruby-2.0.0-head@global/bin:/Users/ryan/.rvm/rubies/ruby-2.0.0-head/bin:/Users/ryan/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
这也不对,因为它中有更多多个 PebbleSDK。
我有三个问题:
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
文件位于何处?
答案 0 :(得分:2)
检查~/.bashrc
或.bash_profile
以获取将作业PATH=...
作为参数传递给cd
的代码。