meimei10251314 发表于 2016-1-1 13:01:59

Linux创建环境变量(Mac OS)

  1./etc/profile
  if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
# 加载自已的环境变量
if [ -f ~/.bashrc ] ; then
. /Users/your_path/.bashrc
fi

2. ./Users/your_path/.bashrc
  # .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# 创建环境变量
export GOPATH=$HOME/Documents/gocode
# 创建命令的别名
alias cdgo='cd $HOME/Documents/gocode'
alias st='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'
export PATH="$PATH:$GOPATH/bin"
页: [1]
查看完整版本: Linux创建环境变量(Mac OS)