delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/03/28/18:57:51

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
Date: Thu, 28 Mar 2002 16:58:36 -0700
From: Kevin Butler <kbutler AT campuspipeline DOT com>
Subject: Problem with globbing and single backslash in expanded variable
To: cygwin AT cygwin DOT com
Reply-to: kbutler AT campuspipeline DOT com
Message-id: <3CA3AE2C.7080602@campuspipeline.com>
MIME-version: 1.0
X-Accept-Language: en-us, en
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.9) Gecko/20020311

I've searched the FAQ & list archives, but didn't find anything that matches this.

There's a strange interaction between globbing and expanding a path with a 
drive-letter-colon-backslash.

For the example, I set up three variables pointing to the cygwin/sbin 
directory, with 0, 1, or 2 backslashes:

PYTHON:d:/cygwin$ D0=d:/cygwin/sbin
PYTHON:d:/cygwin$ D1=d:\\cygwin/sbin
PYTHON:d:/cygwin$ D2=d:\\cygwin\\sbin

Zero works fine:

PYTHON:d:/cygwin$ ls ${D0}/*exe
d:/cygwin/sbin/rmt.exe

One removes the backslash:
PYTHON:d:/cygwin$ ls ${D1}/*exe
d:cygwin/sbin/rmt.exe

Two gets no matches:
PYTHON:d:/cygwin$ ls ${D2}/*exe
ls: d:\cygwin\sbin/*exe: No such file or directory

I would call it just a regex matching issue, except it only acts strange when 
the single backslash is in an expanded variable and globbing is required:

PYTHON:d:/cygwin$ ls d:\\cygwin/sbin/*exe
d:\cygwin/sbin/rmt.exe
PYTHON:d:/cygwin$ ls ${D1}/rmt.exe
d:\cygwin/sbin/rmt.exe

I've verified this with a brand-new cygwin installation on NT 4.0 SP6a.

Is this a bug, or do I need to grok globbing a little deeper?

Thanks!

kb


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

- Raw text -


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