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

2012-12-11 Thread Chet Ramey
On 12/11/12 5:08 AM, Roman Rakus wrote: > Interesting. So it is up to script writer to delete duplicates. Will you be > interested in patch which will clear duplicates? Let's say it will be some > function run after expansion. And it will be optionally turned on. I guess > it will not have any hig

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

2012-12-11 Thread Roman Rakus
On 12/10/2012 11:29 PM, Chet Ramey wrote: On 12/5/12 3:17 AM, Roman Rakus wrote: Works well when used up to 2 levels of ** - ** and **/** is fixed. However still produce duplicates, when used more levels - **/**/**. Also produce duplicates for **/a/** form. The next version will treat any seq

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

2012-12-10 Thread Chet Ramey
On 12/5/12 3:17 AM, Roman Rakus wrote: > Works well when used up to 2 levels of ** - ** and **/** is fixed. > However still produce duplicates, when used more levels - **/**/**. Also > produce duplicates for **/a/** form. The next version will treat any sequence of **/** the same as **, so those

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

2012-12-05 Thread Roman Rakus
On 12/05/2012 04:07 AM, Chet Ramey wrote: 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

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

2012-12-04 Thread Chet Ramey
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'

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

2012-12-02 Thread Roman Rakus
On 12/02/2012 05:57 PM, Ulf Magnusson wrote: Oh - you need to enable 'globstar', not 'extglob'.:) /Ulf Yes, you're right. Bash incorrectly expands to empty string and duplicated results. RR

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

2012-12-02 Thread Ulf Magnusson
On Sun, Dec 2, 2012 at 5:42 PM, Ulf Magnusson wrote: > On Sun, Dec 2, 2012 at 5:40 PM, Ulf Magnusson wrote: >> On Sun, Dec 2, 2012 at 4:58 PM, Roman Rakus wrote: >>> On 12/01/2012 04:41 PM, Ulf Magnusson wrote: GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu) Take the

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

2012-12-02 Thread Ulf Magnusson
On Sun, Dec 2, 2012 at 5:40 PM, Ulf Magnusson wrote: > On Sun, Dec 2, 2012 at 4:58 PM, Roman Rakus wrote: >> On 12/01/2012 04:41 PM, 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: >>

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

2012-12-02 Thread Ulf Magnusson
On Sun, Dec 2, 2012 at 4:58 PM, Roman Rakus wrote: > On 12/01/2012 04:41 PM, 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 >> $

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

2012-12-02 Thread Roman Rakus
On 12/01/2012 04:41 PM, 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

Some globstar patterns produce duplicate entries and a null filename

2012-12-01 Thread Ulf Magnusson
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 $ fo