Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 2 Oct 2002 16:03:33 -0300 (ADT) From: Joey Bernard X-X-Sender: bernard AT bernardlx To: cygwin AT cygwin DOT com Subject: Re: Bash script and export CLASSPATH In-Reply-To: <20021002185606.79218.qmail@web40201.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII This is the way shells usually work. When you execute a shell script, it gets executed as a new process. Unfortunately, child processes cannot affect the environment of the calling parent. This means that the process executing the shell script cannot influence the environment of the process giving you your commandline prompt. If you were to check the value of $CLASSPATH within your shell script, you would see that it would be set correctly. If you want to change environment variables, most shells allow you to source files to set the environment variables. On Wed, 2 Oct 2002, Brian Rowe wrote: > Hello, > If I export CLASSPATH=blah on the command line it > works fine. If I write a shell program that sets the > CLASSPATH it won't set it! When I echo the value its > right from the script, but when its done the CLASSPATH > is not set. Any ideas on why this wouldn't work? > > #!/bin/sh > export CLASSPATH="C:\jdk\lib\tools.jar" > > Run that, then check echo $CLASSPATH at the command > line and CLASSPATH is the same. > odd? > > > __________________________________________________ > Do you Yahoo!? > New DSL Internet Access from SBC & Yahoo! > http://sbc.yahoo.com > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > > If you don't give cats milk, they turn back into dragons. Joey Bernard Programmer/Analyst, Projects Division CARIS 264 Rookwood Ave. Fredericton, New Brunswick Canada, E3B 2M2 E-mail: joey DOT bernard AT caris DOT com Tel: (506) 462-4206 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/