Is there a simpler way to write:
wc -l foo?.txt foo??.txt ?
Since in my case I have (at most) two digit numbers, I tried using the range specification wc -l foo[1-99].txt but this ended up displaying only results between 1 and 9 (instead of 99). But this is a (nonworking) hack, and I really need something like wc -l foo[?,??].txt.
[2-23]means any one of the characters 2 through 2 or the character 3. So, yes, the documentation looks bogus. – John1024 Aug 03 '16 at 20:28shopt -s extglob– Rinzwind Aug 03 '16 at 20:29{,[0-9]}[0-9]works too with less typing. – Random832 Aug 04 '16 at 01:44