![我使用的是 Mac 版本 10.15.3,並面臨錯誤 [-bash: chsh: command not find] 。](https://rvso.com/image/170667/%E6%88%91%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%20Mac%20%E7%89%88%E6%9C%AC%2010.15.3%EF%BC%8C%E4%B8%A6%E9%9D%A2%E8%87%A8%E9%8C%AF%E8%AA%A4%20%5B-bash%3A%20chsh%3A%20command%20not%20find%5D%20%E3%80%82.png)
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
(base) Ashutoshs-MacBook-Air:~ ashutoshrudraksh$
(base) Ashutoshs-MacBook-Air:~ ashutoshrudraksh$ chsh -s /bin/zsh
-bash: chsh: command not found
(base) Ashutoshs-MacBook-Air:desktop ashutoshrudraksh$ python
-bash: python: command not found
(base) Ashutoshs-MacBook-Air:desktop ashutoshrudraksh$ sudo make install
-bash: sudo: command not found
(base) Ashutoshs-MacBook-Air:desktop ashutoshrudraksh$ echo $PATH
’/usr/local/bin:??
概括
正如你所看到的,我嘗試運行命令
chsh -s /bin/zsh
但我收到了錯誤訊息
chsh:command not found
此外,我嘗試在命令列上執行的任何簡單任務都不再可能,儘管它以前確實有效。現在我總是收到錯誤訊息
command not found
路徑或 shell 預設值是否有問題?任何幫助表示讚賞。
答案1
您以某種方式設法將您設定PATH
為奇怪的值。
PATH
macOS 系統上的預設值:
$ getconf PATH
/usr/bin:/bin:/usr/sbin:/sbin
chsh
位於/usr/bin
:
$ command -v chsh
/usr/bin/chsh
您應該重新訪問 shell 的初始化文件,看看您做了什麼來破壞PATH
.
您應該仍然可以使用chsh
,但除非您修正PATH
變數的值,否則您必須提供實用程式的完整路徑:
/usr/bin/chsh -s /bin/zsh