X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <46F99F19.A8F785F@dessent.net>
Date: Tue, 25 Sep 2007 16:51:53 -0700
From: Brian Dessent <brian@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: cygpath -u  doesn't seem to convert spaces properly
References: <fdc59a$ng5$1@sea.gmane.org>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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

Jerome Fong wrote:

> I am trying to use cygpath -u to convert my windows path to an unix path
> in my shell script.  However, it has problems with paths that has spaces
> in it.  For example, "cygpath -u c:\Program Files\Java" is converted to
> /cygdrive/c/Program Files/Java, which doesn't work.  Is there a flag
> that I am missing?

The unix version is correct but still has spaces, which means it still
needs proper quoting.  So if you are doing something like this:

ls $(cygpath -u 'c:\Program Files\Java')

then you are not quoting sufficiently.  However, in your example below
you appear to be using the proper amount of quoting:

> $ cygpath -u "$(cygpath -m -s "c:\Program Files\Java")"
> /cygdrive/c/PROGRA~1/Java

So please give us an example of exactly the command that fails, because
there should never be a need to resort to using the 8.3 short filename
ugliness -- especially since this is an optional NTFS feature that can
be disabled in order to speed things up, which means it's not entirely
portable (not to mention wholly unnecessary as long as proper quoting is
used.)

Brian

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

