delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/12/12/23:30:13

From: "Arthur J. O'Dwyer" <ajo AT andrew DOT cmu DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug in command-line globbing
Date: Thu, 12 Dec 2002 23:12:57 -0500 (EST)
Organization: Carnegie Mellon, Pittsburgh, PA
Lines: 75
Message-ID: <Pine.GSO.4.44L-027.0212122304010.23682-100000@unix14.andrew.cmu.edu>
NNTP-Posting-Host: smtp6.andrew.cmu.edu
Mime-Version: 1.0
X-Trace: bb3.andrew.cmu.edu 1039752777 29763 128.2.10.86 (13 Dec 2002 04:12:57 GMT)
X-Complaints-To: advisor AT andrew DOT cmu DOT edu
NNTP-Posting-Date: 13 Dec 2002 04:12:57 GMT
In-Reply-To: <Xns92E2EA54AD0F2asu1cornelledu@132.236.56.8>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 13 Dec 2002, A. Sinan Unur wrote:
>
> "Arthur J. O'Dwyer" <ajo AT andrew DOT cmu DOT edu> wrote in news:Pine.GSO.4.44L-
> 027 DOT 0212122221540 DOT 23334-100000 AT unix14 DOT andrew DOT cmu DOT edu:
> > On 13 Dec 2002, A. Sinan Unur wrote:
> >> "Arthur J. O'Dwyer" <ajo AT andrew DOT cmu DOT edu> wrote in news:Pine.GSO.4.44L-
> >> 027 DOT 0212122147030 DOT 22577-100000 AT unix14 DOT andrew DOT cmu DOT edu:
> >> >
> >> > [A. Sinan Unur wrote: something suggesting I clarify my question.]
> >> >
> >> > On Thu, 12 Dec 2002, Arthur J. O'Dwyer wrote:
> >>
>
> > The (error-corrected) Request still stands, I suppose; and I still
> > believe the default behavior to be a bug in the implementation.
> > Notice that the "globbing" doesn't complain about mismatched quotes,
> > and makes some argument values impossible to construct.
>
> OK. So, the problem is that when you invoke test as
>
> C:\Dload\misc>test "*\\" hello
>
> you get the output
>
> :*\" hello:
>
> instead of the intended
>
> :*\:
> :hello:
>
> That indeed looks like a bug in that one expects \\ to mean \.

Mm-hm.  I think it's a bug in the globbing code.

> I don't know if one of
>
> C:\Dload\misc>test "*\ " hello
> :*\ :
> :hello:
>
> or
>
> C:\Dload\misc>test "*"\ hello
> :*\:
> :hello:
>
> is acceptable to you.

The second one certainly looks like it satisfies The Request, although
in an ideal world (with correct globbing), the second one would/should
produce some sort of error.

> If you are writing a tr-clone, your best bet might be to disable globbing
> (i think this is not so bad since globbing is meant to work with file
> names).

Yeah, that's what I've done as a stopgap measure.  But it would be
nice if globbing worked correctly, so one could invoke a program as

% tr -d '*\' *.txt

and have it work as expected.  I don't know why I'd want to delete all
asterisks and backslashes in all my text files, but it would be nice
if it were _possible_.  (And yes, that's not quite standard 'tr' syntax,
but if I could get the argument globbing to work properly, that would
be the next extension I'd make...)

Sorry about the / \ mistake again.

-Arthur,
who is sending a bug report to delorie.com as we speak


- Raw text -


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