|
From: Keith M. <kei...@to...> - 2006-03-17 10:51:54
|
Walter Belhaven wrote: > Is there a way to change my username and/or home directory in > MinGW? I searched the archives but didn't see the answer. > > I do see how to do it in cygwin, but I don't see the equivalent > of /etc/passwd in MinGW. I do see C:/msys/1.0/etc/profile which > contains these fateful lines: > > # Set up USER's home directory > if [ -z "$HOME" ]; then > HOME="/home/$LOGNAME" > fi So if you define HOME before MSYS starts, say by adding a user environment variable via Windoze Control Panel, then the value you define there will persist -- this code only sets HOME if it hasn't been previously defined. > Can I just edit this to say something like "HOME="/home/foo" > without breaking everything? We don't recommend customising /etc/profile, simply because if you subsequently upgrade your MSYS installation, then your customised settings will be overridden. User customisations are best defined in $HOME/.profile, which isn't overwritten during an upgrade, but of course, HOME needs to be defined *before* $HOME/.profile can be invoked. > I'm the only user on this system, so I don't care if this "breaks" > for someone else. I do care if it breaks for me though. :) I'd > rather not change my Windows username if at all possible. Neither changing the definition of HOME, nor even of LOGNAME, should break anything. Be aware though, that your Windoze user name will persist in the text returned by the `id' command, and in any commits you make to a local CVS -- I wish I knew how to change that, without resorting to Cygwin for *my* local CVS commits. Regards, Keith. |