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

猜你喜欢

转载自www.cnblogs.com/EasonJim/p/9787256.html