On 22.01.2012 13:16, Matthew Seaman wrote:
On 22/01/2012 19:00, clift...@volcano.org wrote:
If rm had an option to take files from standard input, or if
there's another program I'm not aware of which does this, it
could serve as the right-hand side of this.

xargs(1) -- generic solution to taking a list of command arguments from
a file or pipe, and building a command line from them.
...
xargs(1) is very commonly used in pipelines with find(1).

Thanks for making it clear that my comment was unclear. :-)

I had meant a program which reads the input file list as xargs
does and operates directly on its operands as xargs does

I'm very familiar with xargs, and have used it in many a shell script.
However, it has the weakness that it will end up doing many invocations
on the executable operand, as it batches up the input into command line
arguments. I don't know to what extent that overhead would compare to the other sources of overhead discussed earlier, or the overhead of executing
a Perl interpreter opcode per input, but I'd guess it's higher.

I think I tried that specific comparison of xargs rm vs. perl -nle unlink
once, some years ago, for some kind of temp file cleanup, and found the
latter was faster. I don't have any numbers though, and if I did they'd
be long out of date.
  -- Clifton

--
Clifton Royston -- clift...@iandicomputing.com / clift...@volcano.org Custom programming, network design, systems and network consulting services

_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to