CentOS下使用autoenv实现进入特定目录后运行特定环境变量

安装

# 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

posted @ 2018-10-14 18:15  EasonJim  阅读(965)  评论(0编辑  收藏  举报