Linux建立環境變量(Mac OS)

1./etc/profilebash

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"
相關文章
相關標籤/搜索