`

How to export environment variables to parent

阅读更多

say, you set up all the variables in one shell --- env.ksh, as below

 

export JAVA_HOME=/usr/java/jdk1.5.0_09/
export M2_HOME=/home...

export ANT_HOME=/home/apache-ant-1.7.0
export PERFORCE_HOME=/home/perforce
export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$ANT_HOME/bin:$PERFORCE_HOME/bin:$PATH
export P4PORT=....net:1999
export P4CLIENT=..-2-lx

 

if you run ksh env.ksh --- those variables will be only valid in that shell.

 

if you run . ./env.ksh --- those variables can be exported out of the shell to the parent shell.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics