3 ms·
> (like one thing that comes to mind is recursive globbing with two astersisks, but to be honest I have no clue if maybe bash can do that too by now) It can, i
by tmhedberg 14y ago
> (like one thing that comes to mind is recursive globbing with two astersisks, but to be honest I have no clue if maybe bash can do that too by now)
It can, if you set the `globstar` option:
$ shopt -s globstar
$ echo **/*.txt
a/a2/baz.txt a/bar.txt a/foo.txt b/bar.txt b/foo.txt
- reyan 14y agoMore on zsh globbing http://openclassroom.stanford.edu/MainFolder/VideoPage.php?course=PracticalUnix&video=zsh-globbing&speed=100 http://openclassroom.stanford.edu/MainFolder/VideoPage.php?c...
- q_revert 14y agoanother nice one which i get a lot of use out've.. (again, no idea if bash can do this too) $ setopt brace_ccl #put this in your ~/.zshrc $ echo {1-3}.pdf {a-d}.pdf 1.pdf 2.pdf 3.pdf a.pdf b.pdf c.pdf d.pdf
- jvehent 14y agoBash can do that easily, the syntax is just a bit different $ echo {1..3}.pdf {a..d}.pdf 1.pdf 2.pdf 3.pdf a.pdf b.pdf c.pdf d.pdf
- dima55 14y agoThe parent was wrong, and bash can't do the thing he MEANT. The above aren't globs, they just generates strings. None of those files need to exist. In zsh you can use <7-10>.txt to match 7.txt, 8.txt, 9.txt and 10.txt. Zero-padding is loose. 07.txt and 08.txt match also, for instance. The bash {..} syntax just doesn't handle this variable 0-padding case, which is extremely common when looking at a directory full of photos, for instance.