X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,FB_WORD1_END_DOLLAR X-Spam-Check-By: sourceware.org Message-ID: <4B9775C2.8000300@towo.net> Date: Wed, 10 Mar 2010 11:34:42 +0100 From: Thomas Wolff User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: allow executing a path in backslash notation References: <720660 DOT 16774 DOT qm AT web88302 DOT mail DOT re4 DOT yahoo DOT com> <20100310092536 DOT GS6505 AT calimero DOT vinschen DOT de> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On 10.03.2010 11:03, Ilya Beylin wrote: > The problem is that DOS paths are treated differently, even within the > same program. > Take for instance, bash: > > $ builtin test -x "$WINDIR\system32\cmd.exe"&& echo ok > yes > $ builtin exec "$WINDIR\system32\cmd.exe" /C echo ok > -bash: exec: C:\WINDOWS\system32\cmd.exe: not found > > That makes a lot of headache both for users and for programmers who > have to remember about all such special cases > Not really for programmers, as Corinna has demonstrated, unless you refer to shell script programmers. So there's fewer special situations in which this might be relevant, I think. And the limitation doesn't need "exec" to be involved but applies to "normal" invocation as well as file name expansion, too. Surprising (and the trigger of my response) is the observation that a single "/" substituted for one backslash, i.e. a mixed style path name, changes the situation: $ echo D:\\cygwin17\\bin\\min*.exe D:\cygwin17\bin\min*.exe $ echo D:\\cygwin17\\bin/min*.exe D:\cygwin17\bin/mined.exe D:\cygwin17\bin/mintty.exe So maybe for consistency it might be worth patching bash to fully support DOS style paths? ------ Thomas > Cheers > Ilya > > On 10 March 2010 10:25, Corinna Vinschen wrote: > >> On Mar 9 13:47, Ilguiz Latypov wrote: >> >>> >>>> The bottom line is that if you want to use MS-DOS >>>> paths, then use a MinGW or DJGPP version of make.exe. make.exe is not >>>> going to be patched. >>>> >>> The patch was to cygwin1.dll, but I am not insisting. >>> >> Trouble is, I don't even see the problem. Executing a file in DOS >> notation is already possible: >> >> bash$ cat<< EOF> exec.c >> #include >> >> int >> main (int argc, char **argv) >> { >> char *args[] = { argv[1], "abc", 0}; >> execv (argv[1], args); >> return 1; >> } >> EOF >> bash$ gcc -o exec exec.c >> bash$ ./exec /bin/echo >> abc >> bash$ ./exec C:\\cygwin\\bin\\echo >> abc >> >> >> Corinna >> >> -- >> Corinna Vinschen Please, send mails regarding Cygwin to >> Cygwin Project Co-Leader cygwin AT cygwin DOT com >> Red Hat >> >> -- >> Problem reports: http://cygwin.com/problems.html >> FAQ: http://cygwin.com/faq/ >> Documentation: http://cygwin.com/docs.html >> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple >> >> >> > -- > Problem reports: http://cygwin.com/problems.html > FAQ: http://cygwin.com/faq/ > Documentation: http://cygwin.com/docs.html > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple