delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/02/24/15:43:35

From: dumser AT rtis DOT ray DOT com (James Dumser)
Subject: Re: bash and ~
24 Feb 1998 15:43:35 -0800 :
Message-ID: <34F2CE25.CA585201.cygnus.gnu-win32@rtis.ray.com>
References: <199802231546 DOT KAA20557 AT scotch DOT mae DOT cornell DOT edu>
Mime-Version: 1.0
To: Daniel Karipides <karipid AT mae DOT cornell DOT edu>
Cc: gnu-win32 AT cygnus DOT com

On Mon, 23 Feb 1998 10:46:06 -0500, Daniel Karipides 
  <karipid AT mae DOT cornell DOT edu> wrote:
> I have defined the enivornment variable $HOME to:
>   D:\Users\smith
> I need it defined this way so that emacs (among other programs) works
> correctly when not started from bash.  However, in bash I noticed the
> following:
>   bash$ echo $HOME
>   D:\Users\smith        <--seems to work
>   bash$ cd ~
>   bash.exe: D:Userssmith: No such file or directory

I send someone info on this recently -- don't remember if it was you or
not, Daniel -- but apparently it justifies a reply to the list.

It's important to remember that ~ != $HOME in that they are not the same
variable. ~ is set *ONLY* when bash is started. $HOME can be changed at
any time. So, to accomplish what you want:

  autoexec.bat / environment setup:
    set HOME=d:\users\smith

  startbash.cmd (or .bat):
    @echo off
    set HOME=d:/users/smith
    bash

  .bashrc / .profile:
    set HOME=d:\\users\\smith (or 'd:\users\smith')

The idea is to "fix" $HOME just prior to starting bash so ~ is set
correctly and then setting it back so that emacs will work.

-- 
James Dumser    972.462.5335    dumser AT rtis DOT ray DOT com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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