4 ms·
Please note that 'each' is fundamentally different from 'xargs'. echo 1 2 3 | each "rm {}" is the same as rm 1 rm 2 rm 3 while echo 1 2 3 | xargs
by teo_zero 1y ago
Please note that 'each' is fundamentally different from 'xargs'.
echo 1 2 3 | each "rm {}"
is the same as
rm 1
rm 2
rm 3
while
echo 1 2 3 | xargs rm
is the same as
rm 1 2 3
I would rather say that 'each' replaces (certain uses of) 'for':
for i in 1 2 3; do rm $i; done
- jgtrosh 1y agoIt's equivalent to xargs -I {} rm {} -I replace-str Replace occurrences of replace-str in the initial-arguments with names read from standard input. Also, unquoted blanks do not terminate input items; instead the separator is the newline character. Implies -x and -L 1.