shell知识库[2]: shell环境变量设置以及set,env,export的区别

栏目:shell知识库 作者:admin 日期:2018-10-22 评论:0 点击: 597 次

shell变量包括的局部变量以及用户变量

set显示局部变量以及用户变量,
env显示用户变量变量
export显示当前导出成用户变量的局部变量。


使用unset命令来清除环境变量,注意set env export设置的变量,都可以用unset来清除的

最根本的设置、更改变量的配置文件 ~/.bash_profile   ~/.bashrc   ~/.bash_logout
~/.bash_profile  用户登录时被读取,其中包含的命令被执行
~/.bashrc  启动新的shell时被读取,并执行
~/.bash_logout  shell 登录退出时被读取

shell知识库[2]: shell环境变量设置以及set,env,export的区别:等您坐沙发呢!

发表评论