2 ms·
A benefit I didn't mention in the post (but probably should) is that the pipe lets you interpose other tools. That is, find -exec is sort of "hard-coded", whil
by chubot 5y ago
A benefit I didn't mention in the post (but probably should) is that the pipe lets you interpose other tools.
That is, find -exec is sort of "hard-coded", while find | xargs allows obvious extensions like:
find | grep | xargs # filter tasks
find | head | xargs # I use this all the time for faster testing
find | shuf | xargs
Believe it or not I actually use find | shuf | xargs mplayer to randomize music and videos :)
So shell is basically a more compositional language than find (which is its own language, as I explain here: http://www.oilshell.org/blog/2021/04/find-test.html http://www.oilshell.org/blog/2021/04/find-test.html )