1. 程式人生 > >CentOS下使用autoenv實現進入特定目錄後運行特定環境變量

CentOS下使用autoenv實現進入特定目錄後運行特定環境變量

使用 usr audio aud ash none bin bashrc class

安裝

# Mac
git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv
# 安裝默認shell
echo ‘source ~/.autoenv/activate.sh‘ >> ~/.bashrc
# 安裝了zsh
echo ‘source ~/.autoenv/activate.sh‘ >> ~/.zshrc

# CentOS
git clone git://github.com/kennethreitz/autoenv.git ~/.autoenv
echo ‘source ~/.autoenv/activate.sh‘ >> ~/.bashrc

使用

在目錄下新建一個文件.env,然後裏面可以寫特定的shell,比如:source /usr/bin/test

參考:

https://github.com/kennethreitz/autoenv

CentOS下使用autoenv實現進入特定目錄後運行特定環境變量