bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some globstar patterns produce duplicate entries and a null filename


From: Chet Ramey
Subject: Re: Some globstar patterns produce duplicate entries and a null filename
Date: Tue, 04 Dec 2012 22:07:09 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

On 12/1/12 10:41 AM, Ulf Magnusson wrote:
> GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)
> 
> Take the following example, assumed to be run in an empty directory:
> 
> $ mkdir a
> $ echo **
> a
> $ echo **/**
>  a a
> $ echo **/**/**
>  a a a
> 
> I would expect the result to be just 'a' in all cases.
> 
> You also get back a null filename, as shown by
> 
> $ for f in **/**/**; do echo "'$f'"; done
> ''
> 'a'
> 'a'
> 'a'

Thanks for the report.  This is definitely a problem.  It will be fixed
in the next version of bash, and may be released as a future patch.  I've
attached a patch for you to test; it fixes the problem for me without
introducing any new errors.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

Attachment: globstar-star-star.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]