beginner question: using 'set VAR=...'

Dan Kegel dank@kegel.com
Tue Apr 22 19:14:00 GMT 2003


tek1 wrote:
> Because I only want them on occasion.  I would like to be able to 
> execute the script (.bat or .sh) and have the environment variables 
> defined in the script available during that particular session...

What kind of session are you talking about?  If it's a wcmd
session, the .bat file settings should indeed persist.
If it's a shell session, then you need to source (not run)
a shell script to get persistant settings.  In bash, the
command to source a script is '.', e.g.
   . foo.sh
Any variables set in foo.sh will then persist in the current
shell session (and any sessions it spawns).

Methinks tek1 needs to get more familiar with how Unix
environment variables work... I have a few shell tutorials
at http://www.kegel.com/linux/training.html, maybe one
of them would help.
- Dan


-- 
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list