Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3C606299.1020400@Salira.com>
Date: Tue, 05 Feb 2002 14:54:17 -0800
From: Andrew DeFaria <ADeFaria@Salira.com>
Organization: Salira Optical Networks
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
X-Accept-Language: en-us
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: $HOME Directory Relocation
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 05 Feb 2002 22:54:18.0103 (UTC) FILETIME=[0AB5C070:01C1AE98]

Michael A Chase wrote:
 >> 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:

 > The problem with setting HOME to a fixed value in cygwin.bat or
 > /etc/profile is that limits your cygwin installation to a single user.
 > That's why the default /etc/profile allows $HOME to be passed
 > through from the user's Windows environment.

I never understood this about the default /etc/profile. If I run a 
mkpasswd -d (since I'm in a domain) I see the home field properly 
formatted from the NT domain controller (except I change it to 
/home/$USER and use a mount for /home under Cygwin). Thus my 
/etc/profile is:

USER="`id -un`"
HOME=`grep ^$USER: /etc/passwd | cut -f6 -d:`
SHELL=`grep ^$USER: /etc/passwd | cut -f7 -d:`

# Set up USER's home directory
if [ -z "$HOME" ]; then
  echo "WARNING: HOME not set! Defaulting to /home/$USER."
  HOME="/home/$USER"
fi

if [ ! -d "$HOME" ]; then
  echo "WARNING: HOME directory did not exist! Logging in with HOME = /tmp"
  HOME="/tmp"
fi

export HOME USER SHELL


-- 
Salira <http://www.salira.com>

Ethernet Simple, Fiber Fast

------------------------------------------------------------------------
5751 Patrick Henry Drive
Santa Clara, California 95054
Phone: (408)-855-8860x121
Email: ADeFaria@Salira.com 
<mailto:Andrew%20DeFaria%20%3CADeFaria@Salira.com%3E>
Web: http://www.salira.com

Andrew DeFaria <http://www.defaria.com>

Clearcase Administrator
Email: Andrew@DeFaria.com <mailto:Andrew@DeFaria.com>
Home http://www.defaria.com




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

