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