bash_profile 中的别名在 MacOS Catalina 升级后无法使用

Alias in bash_profile not working after MacOS Catalina upgrade

我刚刚从 macOS Mojave 升级到 macOS Catalina (10.15.2)。我在 ~/.bash_profile 中使用了别名,但在 Catalina 升级后它停止工作了。

alias mci='mvn clean install'
alias mcit='mvn clean install -Dmaven.test.skip=true'
alias mcid='mvn clean install -Dmaven.surefire.debug'

我该怎么办?

您使用哪种 shell? bash? zsh?

您是否更改了您的其他内容:

.个人资料 .bash_profile .bashrc

如果你可以在这里添加你的文件,也许文件的开头有一个 "bug"?

似乎 catalina 已将默认 shell 更改为 zsh。所以也许移动你的 .bashrc 现在是 .zshrc,.bash_profile 现在是 .zprofile 将解决这个问题。

然后返回 bash 而不是

你可以列出炮弹

 cat /etc/shells 

在终端中,更新您的帐户以使用 bash 运行 chsh -s /bin/bash。如果需要输入密码并关闭并重新打开