【发布时间】:2023-04-01 16:29:01
【问题描述】:
我已经使用 bash 两年了,只是尝试通过自制软件在我的 OS X 上切换到 zsh shell。我将我的默认(登录)shell 设置为 zsh,并确认它设置正确,因为当我启动终端时,它是默认使用的 zsh shell。
但是,当我尝试从 zsh 中进入 bash shell 时,它似乎没有加载 ~/.bash_profile,因为我无法使用别名运行我的命令,别名在我的 ~/.bash_profile 中定义,如 alias julia="~/juila/julia" 等。另外,提示不是我在文件中设置的,而是返回bash-3.2$。
由于某些原因,当我将登录 shell 设置为 bash,并从 bash 中输入 zsh 时,~/.zshrc 被正确加载。
那么为什么我在 zsh 中运行 bash 时没有加载它?我的~/.bash_profile 符号链接到~/Dropbox/.bash_profile,以便与我的其他计算机同步。也许它会导致问题?
【问题讨论】:
-
运行后您的别名是否可用
source ~/.bash_profile?
标签: bash macos shell zsh zshrc