Rez*_*avi 18 bash shell zsh environment-variables macos-catalina
我想将添加到该行下方的环境变量设置为~/.bash_profile
,~/.profile
但是它不起作用。
export JBOSS_HOME=/Users/{USERNAME}/Desktop/jboss7
Run Code Online (Sandbox Code Playgroud)
Ros*_*nko 57
如果您出于某种原因(如我)不想重命名/移动您的~/.bash_profile
文件,您可以执行以下操作:
~/.zprofile
source ~/.bash_profile
小智 50
Apple已将默认外壳程序更改为zsh。因此,您必须重命名配置文件。.bashrc
现在.zshrc
和.bash_profile
现在.zprofile
。
您只需复制现有的 bash_profile 并将其命名为 zprofile 即可正常工作。
cp ~/.bash_profile ~/.zprofile
小智 5
我创建了一个名为的新文件
/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
Run Code Online (Sandbox Code Playgroud)
然后我打开了terminal.app
[cmd-comma]的设置。在General
选项卡下,选择单选按钮Command (complete path)
在文本框中将文本从 更改/bin/zsh/
为/usr/local/bin/bash
。