I have this directory structure:
~/tmp/globstar ɀ find dir -type f dir/file.ext dir/subdir1/file.ext dir/subdir2/file.ext
and, with the
globstar option enabled in Bash, I can say:
~/tmp/globstar ɀ ls -1 dir/**/*.ext dir/subdir1/file.ext dir/subdir2/file.ext
My question is: why is
dir/file.ext excluded from this list?
Bash manual says this about
If set, the pattern ‘**’ used in a filename expansion context will match all files and zero or more directories and subdirectories. If the pattern is followed by a ‘/’, only directories and subdirectories match.
“zero” in this paragraph let me with the impression that
dir/file.ext should have been included; unless I’m hopefully missing something.