X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 	tests=AWL,BAYES_00,J_CHICKENPOX_73,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: Andrew DeFaria <Andrew@DeFaria.com>
Subject:  Re: Forward slashes in path and pipes
Date:  Thu, 30 Jul 2009 22:24:58 -0700
Lines: 63
Message-ID: <h4tv7c$3gl$1@ger.gmane.org>
References:  <h4tnoi$lvr$1@ger.gmane.org> <4A726C93.9090403@gmail.com>
Mime-Version:  1.0
Content-Type:  text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 2.0.0.22 (X11/20090608)
In-Reply-To: <4A726C93.9090403@gmail.com>
X-Stationery: 0.4.9
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com



Dave Korn wrote:
> Andrew DeFaria wrote:
>> Found out a funny thing about Cygwin today. I've known for a while that
>> forward slashes works as well as backslashes when specifying a path to
>> execute. So all of the following work from a cmd prompt:
>>
>> C:> C:\Cygwin\bin\ls
>> C:> C:\Cygwin/bin\ls
>> C:> C:/Cygwin/bin/ls
>>
>> Also the following works:
>>
>> C:> C:\Cygwin\bin\ls | more
>>
>> However the following fails:
>>
>> C:> C:\Cygwin/bin\ls | more
>>
>> It fails with something like "C:\Cygwin\bin not found" (From memory).
>>
>> What does this have to do with Cygwin you say?
>
> Nothing. This is cmd.exe's idiosyncratic command-line parsing behaviour. 
Agreed.
> Try quoting it:
My personal solution was to change "/"'s -> "\"'s in the Perl function 
that I wrote to return the Windows oriented path to Cygwin's bin.
>
>> C:\Documents and Settings\Administrator>C:\Cygwin/bin\ls | more
>> 'C:\Cygwin' is not recognized as an internal or external command,
>> operable program or batch file.
>>
>> C:\Documents and Settings\Administrator>"C:\Cygwin/bin\ls" | more
>> Application Data
>> Cookies
>> Desktop
>> Favorites
>> Local Settings
>> My Documents
>> NTUSER.DAT
>> NetHood
>> PrintHood
>> Recent
>> SendTo
>> Start Menu
>> Templates
>> default.pls
>> ntuser.dat.LOG
>> ntuser.ini
>> schedlog.txt
>>
>>
>> C:\Documents and Settings\Administrator>
> For some reason (the presence of the pipe?) cmd.exe parses the forward 
> slash as an options separator rather than a path component in one case 
> but not the other. Quoting removes the ambiguity.
Yes, my Cygwin question would be why does it store "/" in the registry 
for what is obviously a Windows path?
-- 
Andrew DeFaria <http://defaria.com>
Five out of four people have trouble with fractions.


--
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

