Persisting values of environment variables

Eric Blake ebb9@byu.net
Thu Nov 24 14:25:00 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Nate Meyer on 11/23/2005 11:27 AM:
> I'm trying to change the value of $HOME. If I do something like "export
> HOME="c:/whatever" $HOME is changed for that session. But after Cygwin is
> closed and restarted $HOME is set back to the default /home/user. How can I
> persist the change to $HOME?

Windows way - edit your environment.  On Win9x, do it in c:\autoexec.bat.
 On an NT family (including XP), open up control panel, system, advanced,
environment variables (wasn't that so intuitive? I wish Microsoft would
have made it more accessible).  Now every program, cygwin or otherwise,
will see the change.

Cygwin way - edit your startup scripts.  For example, if you use bash,
create or modify ~/.bash_profile.  Note that the change is only seen by
cygwin programs, and only after that part of your startup scripts has been
sourced.  One other thing to look at is cygwin.bat, so that you set HOME
before firing off your shell but don't have to edit the environment for
all Windows programs.

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDhcGn84KuGfSFAYARAu3yAJ9TBoOR22BSVY5R1NYH+E/fp3PYfgCcDeRS
sKygWR6A1FOySsiNAa/if7U=
=a+Li
-----END PGP SIGNATURE-----

--
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