【发布时间】:2019-09-23 11:19:06
【问题描述】:
每次我打开终端我都会收到这条消息:
Last login: Sun May 5 18:30:40 on ttys000
-bash: Setting: command not found
Marcos-MacBook-Pro:~ (myname)$
如您所见,我的 bash_profile 存在问题:
-bash: Setting: command not found
我相信这是因为我不小心使用vim 命令修改了文件。
我将发布修改后的 .bash_profile 文件,希望您能轻松发现其中是否有任何问题:
Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
alias python=python3
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
".bash_profile" 7L, 188C
我真的看不出有什么问题,但我是终端机上的新手。也许有办法将文件重置为默认值?
【问题讨论】:
-
查看 .bash_profile 的第二行。
-
你不需要
export PATH;您的外壳已经从环境中获取它。别名应该放在.bashrc,因为它只用于交互式shell,不会从您的初始登录shell 继承。 (由于macOS终端仿真器通常不是从 shell 会话启动的,因此最好从.bash_profile获取.bashrc。)