Mac OS X 终端和 PATH 变量

Mac OS X 终端和 PATH 变量

我已将 PATH 变量定义添加到我的~/.profile文件中:这里是:

export PATH=/usr/bin:/bin:/usr/sbin:/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/
:~/Documents/development/adt-bundle-mac/sdk/platform-tools/:/opt/local/bin:/opt/local/sbin:$PATH

##
# Your previous /Users/mighter/.profile file was backed up as /Users/mighter/.profile.macports-saved_2012-12-24_at_16:42:03
##

# MacPorts Installer addition on 2012-12-24_at_16:42:03: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

问题是每次我启动终端时都会有以下输出:

-bash: :~/Documents/development/adt-bundle-mac/sdk/platform-tools/:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/Applications/Xcode.app/Contents/Developer/usr/libexec/git-core/:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/: No such file or directory

我确信所有目录都存在,但找不到问题。

答案1

您的 PATH 行中有一个多余的换行符。

PATH 定义必须在一行中,每个目录用冒号 ( :) 分隔。

相关内容