This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]