Open ghost opened 4 years ago
exclude . & .. $ count .[^.] ..? * 39
$ count . 41
What is ..?*
supposed to expand to? Is that not equivalent to ..*
?
$ ls -a
. .. .hidden visible
$ echo * .*
visible . .. .hidden
$ echo * .[^.]*
visible .hidden
Oh, I see: ..?*
covers files that start with two dots (except ..
). Very nice!
$ ls -a
. .. ..doubledot .hidden visible
$ echo * .*
visible . .. ..doubledot .hidden
$ echo * .[^.]* ..?*
visible .hidden ..doubledot
@dylanaraps Is this worth adding to the book somewhere? Either as a note in 'Count files or directories in directory' or a section dedicated to globbing tricks?
Examples that use globbing such as Count files or directories in directory don't take into account files starting with a dot.