www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/30/14:36:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Date: Thu, 30 Jul 2009 18:36:19 +0000 (UTC)
From: Eric Blake <ericblake AT comcast DOT net>
To: cygwin AT cygwin DOT com
Message-ID: <533517069.6831891248978979849.JavaMail.root@sz0059a.emeryville.ca.mail.comcast.net>
In-Reply-To: <20090728091647.GK18621@calimero.vinschen.de>
Subject: Re: [1.7] bash UNC path bug?
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

> > bash... maybe cygpath, seems to be doing something weird:

Weird - yes.  But buggy - no.

> >
> > $ cygpath -u '\\someuncpath\someshare'
> > //someuncpath/someshare
> > $ echo `cygpath -u '\\someuncpath\someshare'`
> > /cygdrive/c/someuncpath/someshare
> > $ # what's going on here
> > $ echo "`cygpath -u '\\someuncpath\someshare'`"

In a double-quoted `` context, \\ represents one \, and \s
is undefined.  Just because this is nested within a ''
inside the `` does not make it a single-quoted context.
The correct quoting would be:

echo "`cygpath -u '\\\\someuncpath\\someshare'`"

You are better off using $(), with saner quoting rules:
echo "$(cygpath -u '\\someuncpath\someshare')"

[disclaimer - I'm typing this on a machine without bash,
so I was unable to test the above; hopefully I got it
all correct]

-- 
Eric Blake

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019