Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Tue, 2 Oct 2001 21:01:32 +0200 Message-Id: <200110021901.VAA28178@linux.> From: "Ehud Karni" To: cygwin AT cygwin DOT com Subject: Re: bash 2.04 can't complete ~/name if $HOME set to c:/users/foo? In-reply-to: <20011002134419.E12071@redhat.com> (message from Christopher Faylor on Tue, 2 Oct 2001 13:44:19 -0400) Organization: Mivtach-Simon Insurance agencies Reply-to: ehud AT unix DOT simonwiesel DOT co DOT il References: <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20011001192343 DOT 00a74568 AT pop DOT atg DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20011001192343 DOT 00a74568 AT pop DOT atg DOT com> <5 DOT 1 DOT 0 DOT 14 DOT 2 DOT 20011002102745 DOT 00a6df08 AT pop DOT atg DOT com> <20011002134419 DOT E12071 AT redhat DOT com> X-Mailer: Emacs 20.7.1 rmail (send-msg 1.105) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit On Tue, 2 Oct 2001 13:44:19 -0400, Christopher Faylor wrote: > > On Tue, Oct 02, 2001 at 10:33:36AM -0400, Matt Landau wrote: > >At 05:37 AM 10/2/2001, David Starks-Browning wrote: > >>If your non-Cygwin application (like Emacs) requires HOME be set in a > >>non-Cygwin way, then don't start emacs from your Cygwin bash shell. > > > >Let me clarify the problem. > > > >Emacs doesn't care what $HOME is set to, it cares what path it sees on > >the command line. The issue is that bash, by default, expands > >~/filename to a posix-style path, resulting in commands like "emacs > >/c/users/matt/.bashrc", which doesn't work for any non-Cygwin program. > > > > It is unlikely that anyone who is working on cygwin development, a large > part of which is devoted to providing unix path handling, is going to be > overly interested in modifying bash to handle MS-DOS paths. > > So, as has been suggested elsewhere, the best solution is to inspect the > bash source code and provide a fix. I can't speak for anyone else but I > know that I, personally, have no interest in making bash work with > MS-DOS paths. Cygwin has a small program cygpath.exe for this purpose. I wrote a little bash script that I think work around the problem. I call it run-win.sh and you run the M$Windows command thru it. e.g. run-win.sh emacs ~/.bashrc #! /bin/sh -ex # -------------------------------------------------- cnvrt_path () { case "$1" in ~/* | /?/* ) cygpath -w "$1" ;; # argument is filename/path * ) echo "$1" ;; # as is esac } export HOME=`cnvrt_path "$HOME"` # convert home variable CMD="" for VAR in "$@" do CMD="$CMD "`cnvrt_path "$VAR"` # add next var (path converted) done $CMD & # run this command ############################## run-win.sh ############################## I hope this help. Ehud. -- Ehud Karni Mivtach - Simon Insurance /"\ Tel: +972-3-7966-561 Fax: +972-3-7966-667 \ / ASCII Ribbon Campaign (USA) Fax and voice mail: 1-815-5509341 X Against HTML Mail Better Safe Than Sorry / \ mailto:ehud AT unix DOT simonwiesel DOT co DOT il http://www.simonwiesel.co.il -- 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/