简体   繁体   English

为什么在 OSX Catalina 上使用 bash 的终端中有额外的代码行?

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

When running my code I seem to be getting a lot of extra lines of code in the terminal.运行我的代码时,我似乎在终端中获得了很多额外的代码行。

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 has replaced bash shell with zsh shell. Apple 已将 bash shell 替换为 zsh shell。 So this is just a I or information statement being printed out by the system.所以这只是系统打印出来的 I 或信息声明。 If you want to use zsh shell instead of the older bash shell you can follow those steps.如果你想使用 zsh shell 而不是旧的 bash shell 你可以按照这些步骤。 However, in order to silence this warning and continue to use bash itself, you can add this command to ~/.bash_profile or ~/.profile:但是,为了消除此警告并继续使用 bash 本身,您可以将此命令添加到 ~/.bash_profile 或 ~/.profile:

export BASH_SILENCE_DEPRECATION_WARNING=1

You have to open bash_profile file with a text editor add the above line and then save it.您必须使用文本编辑器打开 bash_profile 文件,添加上面的行,然后保存。 Use any text editor of your choice,使用您选择的任何文本编辑器,

touch ~/.bash_profile; open ~/.bash_profile

or或者

nano ~/.bash_profile

or或者

mate ~/.bash_profile

or或者

vim ~/.bash_profile

Hope this helps.希望这可以帮助。

Here's a full tutorial on how to do all of that start to finish.这是有关如何从头到尾完成所有这些操作的完整教程 It's really quite simple, but if you are less familiar with the terminal these steps can be helpful.这真的很简单,但是如果您对终端不太熟悉,这些步骤可能会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM