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 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
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.
Attaching script which I use for testing. RR
test.sh
Description: application/shellscript