MacOS Catalina 升级后 bash_profile 中的别名不起作用

Suh*_*iya 3 macos bash alias macos-catalina

我刚刚从 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'
Run Code Online (Sandbox Code Playgroud)

我该怎么办?

小智 5

你用的是什么壳?砸?zsh?

您是否更改了以下内容:

.profile .bash_profile .bashrc

如果您可以在此处添加文件,也许文件开头存在“错误”?

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