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"


posted on 2014-01-17 15:35  几百人有爱  阅读(249)  评论(0编辑  收藏  举报