delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/14/18:35:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Wed, 14 Sep 2005 18:35:22 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: dalewking AT insightbb DOT com
cc: cygwin AT cygwin DOT com
Subject: Re: How to convert a path to the correct case
In-Reply-To: <091420052217.14094.4328A1710006233B0000370E219791336309020705990A040E0B@insightbb.com>
Message-ID: <Pine.GSO.4.63.0509141830230.12971@slinky.cs.nyu.edu>
References: <091420052217 DOT 14094 DOT 4328A1710006233B0000370E219791336309020705990A040E0B AT insightbb DOT com>
MIME-Version: 1.0

On Wed, 14 Sep 2005, dalewking wrote:

> Cygwin itself is case preserving, but case insensitive. Other tools are
> not so flexible on case. In my case I have some issues with incorrect
> case and my makefile.
>
> Consider if I had a directory /foo/BAR. Cygwin will let you actually do
> "cd /Foo/bar" and work happily. Pwd will actually return "/Foo/bar"
> instead of the real path in this case.
>
> It would be really helpful to have a way given a string like "/Foo/bar"
> to convert that to the real correct case "/foo/BAR".
>
> But I'm having trouble finding an easy, convenient way to do that. As I
> said pwd doesn't do it nor does cygpath.
>
> One way that works is to turn the path into a pattern. You can do "ls
> /Foo/bar*" but that will return multiple strings if there is more than
> one file that starts with BAR. You can do "ls /Foo/ba[r]" but then how
> do I easily add the brackets into the string? I've tried various things
> with find, but none do the conversion.
>
> Anyone have a good idea how to do this conversion.

<http://cygwin.com/cygwin-ug-net/using-cygwinenv.html>, and search for
check_case.  You want "check_case:adjust".  Don't let the warning scare
you off... :-D

Alternatively, if you *are* scared off by the warning, you could do

ls -1 /Foo/bar* | head

HTH,
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. /DA

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

- Raw text -


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