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: $HOME Directory Relocation


Laurence F. Wood writes:
| Hello,
| 
| I needed to relocate the $HOME directory to another disk volume.  Under
| linux the login process sets this.  Who/what sets $HOME under cygwin?

Since no login occurs, place it in your batch file calling bash, or in
/etc/profile like I do. Here is my /etc/profile that correct many such
environment variable problems I found over the time:

###############################################################################
# File:   /etc/profile
# Author: Benoit Rochefort

# This file is only executed at login time!
# Be sure to include both the "--login" and the "-i" options to bash in
# your batch file calling bash in order to have this file sourced.

# Note that CYGWIN environment variable must be set before starting
# bash via the batch file and not here!!!

unset DOSDRIVE
unset DOSDIR
unset TMPDIR
unset TMP

PATH="/usr/local/bin:/usr/bin:/bin${PATH:+:$PATH}:."
MANPATH="/usr/local/man:/usr/man"
export PATH MANPATH

: ${LOGNAME:=${USER:=${USERNAME:=`/usr/bin/id -un`}}}
USER="$LOGNAME"
HOME="/home/$USER"
export LOGNAME USER HOME

MAKE_MODE=unix
export MAKE_MODE

PS1='[\u]\w>'
HISTFILE="$HOME/.bash_history"

cd $HOME 2>/dev/null || cd / 2>/dev/null

###############################################################################

Please consult the man page to know exactly when this file is invoked (for
most user, it is always on Windows).

| 
| 
| --
| Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
| Bug reporting:         http://cygwin.com/bugs.html
| Documentation:         http://cygwin.com/docs.html
| FAQ:                   http://cygwin.com/faq/
| 
| 

-- 
           *., ,.**  Benoit Rochefort  *., ,.**

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]