簡體   English   中英

為什么在 OSX Catalina 上使用 bash 的終端中有額外的代碼行?

[英]Why are there extra lines of code in terminal with bash on OSX Catalina?

運行我的代碼時,我似乎在終端中獲得了很多額外的代碼行。

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.

Apple 已將 bash shell 替換為 zsh shell。 所以這只是系統打印出來的 I 或信息聲明。 如果你想使用 zsh shell 而不是舊的 bash shell 你可以按照這些步驟。 但是,為了消除此警告並繼續使用 bash 本身,您可以將此命令添加到 ~/.bash_profile 或 ~/.profile:

export BASH_SILENCE_DEPRECATION_WARNING=1

您必須使用文本編輯器打開 bash_profile 文件,添加上面的行,然后保存。 使用您選擇的任何文本編輯器,

touch ~/.bash_profile; open ~/.bash_profile

或者

nano ~/.bash_profile

或者

mate ~/.bash_profile

或者

vim ~/.bash_profile

希望這可以幫助。

這是有關如何從頭到尾完成所有這些操作的完整教程 這真的很簡單,但是如果您對終端不太熟悉,這些步驟可能會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM