This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: beginner question: using 'set VAR=...'
- From: Dan Kegel <dank at kegel dot com>
- To: tek1 <tek1 at pobox dot com>
- Cc: cygwin at cygwin dot com
- Date: Tue, 22 Apr 2003 10:12:11 -0700
- Subject: Re: beginner question: using 'set VAR=...'
- References: <4.3.2-J.20030422114455.033ca448@smtp.comcast.net>
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/