X-Recipient: archive-cygwin@delorie.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@comcast.net>
To: cygwin@cygwin.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
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
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

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

