X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Andrew DeFaria Subject: Forward slashes in path and pipes Date: Thu, 30 Jul 2009 20:17:37 -0700 Lines: 30 Message-ID: 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) X-Stationery: 0.4.9 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 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? Well I recently had to figure out the Window's path for Cygwin's bin, actually /usr/bin and what I got back from the registry was something like D:\Profiles\\Cygwin/bin. Note that a default install of Cygwin included a path that included a forward slash. Of course what I was trying to do was a gzip piped to tar -tf -. To my utter surprise the forward slash caused this all to fail. Thoughts? -- Andrew DeFaria Very funny Scotty - now beam down my clothes. -- 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