Shell脚本永久设置环境变量 [英] Shell script to set environment variables permanently
本文介绍了Shell脚本永久设置环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要编写一个Shell脚本来设置环境变量并永久修改路径变量。是否可以通过脚本修改bashrc文件?
I need to write a shell script to set environment variable and modify path variable permanently. Is there in any way to modify bashrc file through script?
推荐答案
是的,您编写了一个脚本。 >>重定向运算符:
Yes, you write a script that appends to .bashrc with the >> redirection operator:
echo Your Text >> ~/.bashrc
另请参见 I / O重定向
这篇关于Shell脚本永久设置环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文