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 15:53:11 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: bash 2.04 can't complete ~/name if $HOME set to c:/users/foo? Message-ID: <20011002155310.A2088@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com 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> <200110021901 DOT VAA28178 AT linux.> <20011002151229 DOT A1904 AT redhat DOT com> <200110021926 DOT VAA31467 AT linux.> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200110021926.VAA31467@linux.> User-Agent: Mutt/1.3.21i On Tue, Oct 02, 2001 at 09:26:34PM +0200, Ehud Karni wrote: >On Tue, 2 Oct 2001 15:12:29 -0400, Christopher Faylor wrote: >> >> You left out the part of my email which actually mentions how to solve this >> problem. There should be no need for cygpath in this case. >> >> Just set the HOME environment variable to a UNIX path. It should work fine >> with native windows apps since HOME will be translated back to MS-DOS format >> prior to executing the program. That's how cygwin works. > >I'm sorry to say that you are wrong. It does not work on W98. >Here is my test: I just *knew* that this thread would degenerate into a long misunderstanding. Lets try again. Cygwin has several environment variables that it translates back and forth between MS-DOS and UNIX format. Two obvious ones are PATH and HOME. When a cygwin process is first started, it translates these variables from MS-DOS format to UNIX format for its internal use. In most cases, when cygwin execs a new process it converts these environment variables back into MS-DOS format so that the new process can see native MS-DOS paths. Just do this: set HOME=c:\tmp bash echo $HOME cmd (or command) echo %HOME% That should illustrate what I'm talking about. As for the example below, it is hard to understand your thought process since you seem to be *explicitly* setting HOME to a Windows path in a shell script. I don't know why you think that "c:\ehuds" qualifies as a UNIX path in this context. It clearly is a MS-DOS path. Setting HOME to a MS-DOS path short circuits the conversion that I mentioned above. In other words, you are creating your own problems by trying to "fix" something that isn't broken. cgf >EHUD-P-II-21:17:56-/etc-519# command.com /c echo ~/tst.run $HOME/xxx >/c/ehuds/tst.run /c/ehuds/xxx >EHUD-P-II-21:19:10-/etc-520# run-win.sh command.com /c echo ~/tst.run $HOME/xxx >+ '[' DONE = '' ']' >++ cnvrt_path /c/ehuds >++ cygpath -w /c/ehuds >+ export 'HOME=c:\ehuds' >+ HOME=c:\ehuds >+ CMD= >++ cnvrt_path command.com >++ echo command.com >+ CMD= command.com >++ cnvrt_path /c >++ echo /c >+ CMD= command.com /c >++ cnvrt_path echo >++ echo echo >+ CMD= command.com /c echo >++ cnvrt_path /c/ehuds/tst.run >++ cygpath -w /c/ehuds/tst.run >+ CMD= command.com /c echo c:\ehuds\tst.run >++ cnvrt_path /c/ehuds/xxx >++ cygpath -w /c/ehuds/xxx >+ CMD= command.com /c echo c:\ehuds\tst.run c:\ehuds\xxx >+ command.com /c echo 'c:\ehuds\tst.run' 'c:\ehuds\xxx' >c:\ehuds\tst.run c:\ehuds\xxx > >EHUD-P-II-21:24:41-/etc-521# uname -a >CYGWIN_98-4.10 EHUD-P-II 1.3.3(0.46/3/2) 2001-09-12 23:54 i686 unknown > >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/ -- cgf AT cygnus DOT com Red Hat, Inc. http://sources.redhat.com/ http://www.redhat.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/