`

环境变量

阅读更多
环境变量在各个操作系统都有,为图省事,将很多目录模拟成当前目录:
使用该目录下的命令时,就不用到它所在的目录下,或者敲全路径。

查看shell的环境变量
  • export
  • env
  • set


在/etc/下面有两个文件
  • profile   
  • profile.d/


把你需要的环境变量,用export导入到你的脚本中:
export ORACLE_HOME=/u01/oracle/ora920


或者

source /etc/profile.d/xx.sh
#其中xx.sh里边还是exprot XX=.....


source的作用:
http://dev.firnow.com/course/6_system/linux/Linuxjs/20071027/80454.html



profile是很重要的东西:
http://www.justwinit.cn/post/3377/
一般分为:
系统profile:/etc/profile
用户profile:~/.bash_profile 、 ~/.bashrc

登陆Linux系统时,首先启动"/etc/profile",
然后启动用户目录下的"~/.bash_profile",
如果"~/.bash_login"和"~/.profile"文件存在的时候,再先启行login。


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics