| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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 |
| Message-Id: | <5.1.0.14.2.20020915093048.01fbc728@pop3.cris.com> |
| X-Sender: | rrschulz AT pop3 DOT cris DOT com |
| Date: | Sun, 15 Sep 2002 09:53:39 -0700 |
| To: | cygwin AT cygwin DOT com |
| From: | Randall R Schulz <rrschulz AT cris DOT com> |
| Subject: | Obtaining Actual File / Directory Names |
| Mime-Version: | 1.0 |
Hi,
Given Igor's fixed cygwin (or any subsequent release with that fix -- and,
of course, the one about the missing newline from the end of the help
output that I reported and Chris F. stated he fixed a few weeks back), one
can obtain the "real" name of a existing file or directory (i.e.,
respecting actual alphabetic case) like this:
realCase() {
cygpath -w -l "$(cygpath -d "$1")"
}
Example:
% touch "thisNameIsPrettyLongAndHasMixedCaseAndAFunkyCh&racter"
% realCase thisnameisprettylongandhasmixedcaseandafunkych\&racter
thisNameIsPrettyLongAndHasMixedCaseAndAFunkyCh&racter
Quoting and options are "exercises for the reader."
I can only confirm that this works as intended on a Windows 2K Pro (the
only system to which I have access).
Randy
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |