当我打开一个新的外壳时,我得到:
\n\nLast login: Sun Mar 23 10:14:46 on ttys000\n\n-bash: \xc2\xa0: command not found\nRun Code Online (Sandbox Code Playgroud)\n\n我不完全确定如何弄清楚那里发生了什么,因为它不完全清楚它正在谈论哪个命令。
\n\n它可能在 .bashrc 文件中吗?
\n\nHISTSIZE=10000\nHISTFILESIZE=20000\n\nexport CLICOLOR=1\nexport LSCOLORS=ExFxCxDxBxegedabagacad\nexport PS1="\\[\\e[01;32m\\]\\h \\[\\e[01;34m\\]\\W \\$(parse_git_branch)\\[\\e[01;34m\\]$\\[\\e[00m\\] "\n\nexport PYTHONSTARTUP=/Users/JimShook/.pythonstartup\nexport WORKON_HOME=$HOME/.virtualenv\nsource /usr/local/bin/virtualenvwrapper.sh\n\n# Setting PATH for Python 2.7\n# The orginal version is saved in .bash_profile.pysave\nPATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"\nexport PATH\n\nfunction parse_git_dirty {\n [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"\n}\n\nfunction parse_git_branch {\n git branch --no-color 2> /dev/null | sed -e \'/^[^*]/d\' -e "s/* \\(.*\\)/[\\1$(parse_git_dirty)]/"\n}\n\nPATH=$PATH:/usr/local/rvm/bin # Add RVM to PATH for scripting\n\n### Added by the Heroku Toolbelt\nRun Code Online (Sandbox Code Playgroud)\n\n或者也许是 bash_profile?
\n\nif [ -f ~/.bashrc ]; then\n \xc2\xa0 \xc2\xa0source ~/.bashrc\nfi\n\n\n[[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # Load RVM into a shell session *as a function*\nRun Code Online (Sandbox Code Playgroud)\n\n任何想法都有帮助。
\n小智 5
需要检查的事项 - 如上所述:
尝试:
cat -v ~/.bashrc ## look for '^M' or other special chars - remove if present
bash -n ~/.bashrc ## try the 'sourced files' separately
Run Code Online (Sandbox Code Playgroud)
如果使用 VI,打开文件后要尝试以下操作: