X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 	tests=AWL,BAYES_00,J_CHICKENPOX_73,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <f60fe000901032112l327424e5p17b6d92f6c772c57@mail.gmail.com>
Date: Sun, 4 Jan 2009 00:12:54 -0500
From: "Mark J. Reed" <markjreed@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Could I use backslash directly as path delimiter on cygwin?
In-Reply-To: <21273102.post@talk.nabble.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <21273102.post@talk.nabble.com>
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

On Sun, Jan 4, 2009 at 12:01 AM, yuanyun.ken wrote:
> Is there a way to use backslash directly as path delimiter on cygwin?

Sure.  As far as I know, any program which uses the cygwin path
processing functions will understand backslash-delimited paths; even
if you find one that doesn't, you can translate for it with cygpath,
which does.  The trick is that backslash is a special quote character
in bash (and other UNIX shells), so that when you type

cd d:\dira\dirb

what the cd command sees is "d:diradirb".  Even if it assumed that
there were backslashes in there that got eaten, it would have no idea
where to put them.

The double-backslash solution you've already found is inconvenient for
copy and paste; a more paste-friendly solution is to use single
quotation marks around the whole path:

cd 'd:\dira\dirb'

If you find an odd command that doesn't understand backslash-delimited
path names, combine the single quotes with cygpath:

oddcmd "$( cygpath 'd:\dira\dirb' )"

-- 
Mark J. Reed <markjreed@gmail.com>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

