delorie.com/archives/browse.cgi | search |
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: | <C2D7D58DBFE9D111B0480060086E96350774D494@mail_server.gft.com> |
From: | =?iso-8859-1?Q?=22Schaible=2C_J=F6rg=22?= <Joerg DOT Schaible AT gft DOT com> |
To: | "Cygwin AT Cygwin. Com" <cygwin AT cygwin DOT com> |
Subject: | RE: $HOME Directory Relocation |
Date: | Wed, 6 Feb 2002 11:08:28 +0100 |
MIME-Version: | 1.0 |
X-Mailer: | Internet Mail Service (5.5.2653.19) |
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id g16AAnP23209 |
Hi Laurence, I tried to correlate Window's home and Cygwin's home by the following lines in /etc/profile. I end up mounting /home to the "Profile" directory of Windows (wherever it may be in the different versions) and set home according to $USERPROFILE that is set by the system. This gives a quite natural Unix feeling for "ls /home", although "ls ~<User>" just works for my own account. ====== snip = snap ========= COMMON_DESKTOP=`regtool get '\HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop'` ALLHOME=`cygpath -u "$COMMON_DESKTOP/../.."` ALLHOME=`cygpath -wsa "$ALLHOME" | tr [a-z] [A-Z]` if [ ! -d /home ]; then mkdir /home fi if [ "$ALLHOME" != "`cygpath -wsa /home`" ]; then echo Mounting `cygpath -wsa $ALLHOME` to /home mount -s -b -f "`cygpath -wsa $ALLHOME`" /home > /dev/null 2>&1 fi unset ALLHOME COMMON_DESKTOP USER="`id -un`" # Set up USER's home directory if [ -z "$HOME" ]; then HOME=`cygpath -ua "$USERPROFILE"` fi HOME=`cygpath -wsa "$USERPROFILE"` HOME=`cygpath -ua "$HOME"` export HOME USER ====== snip = snap ========= Another benefit: Your settings are part of the Window's profile, i.e. can be shared for your account automatically in a server environment for different machines. Regards, Jörg -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |