We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac 使用 bash 做为默认的 shell,MAC OS 环境配置文件如下:
# 系统级别 /etc/profile /etc/paths /etc/bashrc # 用户级别 ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc
前三个是系统级别的环境变量针对所有用户,后面四个带有 ~/ 用户级别的环境变量。
~/
~/.bash_profile
~/.bash_login
~/.profile
~/.bashrc
修改全局环境变量时候参考系统默认的环境变量配置格式。
修改全局环境变量需要 root 权限。
在 ~/.bash_profile 中配置环境,格式如下:
# 使用冒号隔开 export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin export PATH=$PATH:<PATH 1>:<PATH 2>:<PATH 3>:------:<PATH N> # 或者 export PATH=${PATH}:<PATH 1> export PATH=${PATH}:<PATH 2> # 第一种将路径合并在一起,不方便删除,建议使用第二种,换行挨个设置
echo $PATH
# 覆盖是添加 echo 'export PATH=$HOME/openwhisk/bin:$PATH' > "$HOME/.bash_profile" # 增量式添加 echo 'eval "$(register-python-argcomplete wskadmin)"' >> "$HOME/.bash_profile" echo 'export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig'>> "$HOME/.bash_profile"
在环境配置完毕后,重载入配置文件生效,执行以下指令:
source <相应文件配置文件> #示例 source .bash_profile
Mac 每次都要执行source ~/.bash_profile 配置的环境变量才生效
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Mac 使用 bash 做为默认的 shell,MAC OS 环境配置文件如下:
前三个是系统级别的环境变量针对所有用户,后面四个带有
~/
用户级别的环境变量。~/.bash_profile
,~/.bash_login
,~/.profile
依次加载,若~/.bash_profile
不存在,依次加载后面几个文件;若~/.bash_profile
文件存在,后面几个文件不会加载~/.bashrc
在 bash shell 打开时加载全局环境变量设置
修改全局环境变量时候参考系统默认的环境变量配置格式。
修改全局环境变量需要 root 权限。
用户级别环境变量设置
在
~/.bash_profile
中配置环境,格式如下:查看 PATH
命令行添加 PATH
重新载入配置文件
在环境配置完毕后,重载入配置文件生效,执行以下指令:
Other Resources
Mac 每次都要执行source ~/.bash_profile 配置的环境变量才生效
The text was updated successfully, but these errors were encountered: