You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sam <is...@ms45.hinet.net> on 2001/10/08 04:58:22 UTC

Environment setup

Hi all, 
I want to set environment by a shell script.
But it is not work 
why?
  
==
#!/bin/sh
CLASSPATH=.:/usr/local/jdk/lib/tools.jar:/home/sam/tomcat/lib/servlet.jar
export CLASSPATH
==

thanks 



Re: Environment setup

Posted by Jan Labanowski <jk...@osc.edu>.
Assuming that your script is:
------------ cut ----
CLASSPATH=.:/usr/local/jdk/lib/tools.jar:/home/sam/tomcat/lib/servlet.jar
export CLASSPATH
-------------cut ---

(no #!/bin/sh)

and that it is called: my_env

you can use it to set your env under Bourne type shell by sourcing the
script, i.e., by executing: 

. my_env

Notice the dot and space and my_env. Executing my_env as, say, 
   ./my_env
would set up the environment variable for the shell which is forked for
the script (i.e., a child of your login shell). This shell terminates,
as soon as the script terminates, i.e., the scripts sets environment
variable for itself, and then exits -- not what you want to do.


On Mon, 8 Oct 2001, Sam wrote:

> Hi all, 
> I want to set environment by a shell script.
> But it is not work 
> why?
>   
> ==
> #!/bin/sh
> CLASSPATH=.:/usr/local/jdk/lib/tools.jar:/home/sam/tomcat/lib/servlet.jar
> export CLASSPATH
> ==
> 
> thanks 
> 
> 

Jan K. Labanowski            |    phone: 614-292-9279,  FAX: 614-292-7168
Ohio Supercomputer Center    |    Internet: jkl@osc.edu 
1224 Kinnear Rd,             |    http://www.ccl.net/chemistry.html
Columbus, OH 43212-1163      |    http://www.osc.edu/