Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I run the WLST .sh script to set the env as follows why can't I see the updated path when I do echo?

[linbox2 bin]$ ./ 


Your environment has been set.
[linbox2 bin]$ export CLASSPATH 
[linbox2 bin]$ export PATH 
[linbox2 bin]$ echo 
[linbox2 bin]$
share|improve this question

This is because you are executing this script. This means that a new shell process is being created, and the variables defined or modified have a scope only in that subshell. The parent process does not inherit child's environment.

Whenever you want to load an variables defined in a given file, you have to source it:

$ source file


$ . file
share|improve this answer

You can either copy the CLASSPATH=.... until the end and then into a terminal do

export CLASSPATH=...

Or you can just do the following into a terminal

eval `./ ` # this will set into your environment the CLASSPATH

You can check your environment by doing this

env |grep CLASSPATH # look if it matches on what the ./ sets
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.