| ▲ | Dibby053 5 hours ago | |||||||||||||||||||
Some of these are wrong, as standard shell globs don't traverse directories. For instance the first example should be:
I think that would work in Bash just as well as using find.But yeah, even in POSIX it feels redundant when we already have find, seq, grep and whatnot. | ||||||||||||||||||||
| ▲ | js2 2 hours ago | parent | next [-] | |||||||||||||||||||
I thought I knew every nook and cranny of bash, but somehow never noticed the globstar option added in bash 4.0. https://www.linuxjournal.com/content/globstar-new-bash-globb... https://www.gnu.org/software/bash/manual/bash.html#Pattern-M... | ||||||||||||||||||||
| ▲ | wongarsu 4 hours ago | parent | prev | next [-] | |||||||||||||||||||
I frequently have cases where `ls **/*.png` fails because the argument list is too long. Just happened yesterday with an rm I wanted to run. Find works, but the syntax is arcane. Not bad, but unlike any other common cli tool, which makes it more difficult to remember if you haven't needed it in a while | ||||||||||||||||||||
| ||||||||||||||||||||
| ▲ | IsTom 4 hours ago | parent | prev | next [-] | |||||||||||||||||||
To be pendantic
Otherwise it will fail if you've got a file named e.g. --help | ||||||||||||||||||||
| ||||||||||||||||||||
| ▲ | westurner 3 hours ago | parent | prev [-] | |||||||||||||||||||
But `ls -print0` is not an option;
Though, I just realized that this doesn't work yet either:
westurner/dotfiles/scripts/el: "edit lines" https://github.com/westurner/dotfiles/blob/master/scripts/el...`el -v/--verbose` is useful because it prints each input; though, I might not have written `el` if I had been aware of `xargs -n/--max-args=1` | ||||||||||||||||||||