delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/05/17:54:41

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3C606299.1020400@Salira.com>
Date: Tue, 05 Feb 2002 14:54:17 -0800
From: Andrew DeFaria <ADeFaria AT Salira DOT 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 AT cygwin DOT com
Subject: Re: $HOME Directory Relocation
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 AT Salira DOT com 
<mailto:Andrew%20DeFaria%20%3CADeFaria AT Salira DOT com%3E>
Web: http://www.salira.com

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

Clearcase Administrator
Email: Andrew AT DeFaria DOT com <mailto:Andrew AT DeFaria DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019