我想将添加到该行下方的环境变量设置为~/.bash_profile,~/.profile但是它不起作用。
export JBOSS_HOME=/Users/{USERNAME}/Desktop/jboss7
Answers:
Apple已将默认外壳程序更改为zsh。因此,您必须重命名配置文件。.bashrc现在.zshrc和.bash_profile现在.zprofile。
如果出于某些原因(例如我)不想重命名/移动~/.bash_profile文件,则可以执行以下操作:
~/.zprofilesource ~/.bash_profile我创建了一个名为
/usr/local/bin/mybash
其中包含一个包装脚本:
/usr/local/bin/bash --init-file $HOME/.bashrc
我从HomeBrew安装了此local / bin / bash 。
全部事件
brew install bash
echo "/usr/local/bin/bash --init-file $HOME/.bashrc" > /usr/local/bin/mybash
chmod +x /usr/local/bin/mybash
然后,我打开了terminal.app[cmd-逗号]的设置。在General标签下,选择单选按钮Command (complete path)
在文本框中,将文本从更改/bin/zsh/为/usr/local/bin/bash。
您可以复制现有的bash_profile并将其命名为zprofile,它将可以正常工作。
cp ~/.bash_profile ~/.zprofile
您可以创建一个simbolic链接,并使用以下命令保留.bash_profile文件:
ln -s .bash_profile .zsh_profile
source .zsh_profile
.bash_profile中的任何更改都将反映在.zsh_profile中