in reply to Re: Re: Re: grep or perl
in thread grep or perl
It's roughly equivalent to
perl -e 'exec "@ARGV " . join " ", <>'So execute the given program and provided parameters and then add anything read from the pipe as arguments.
This is true, but it might also be useful to note that xargs breaks the command line up into chunks small enough to fit on one command. For example, if you tried passing 40,000 filenames as one big long command line, it wouldn't work. Instead you could echo the 40,000 filenames into xargs (or, more realistically, pipe the output from find or grep), which will break them up accordingly.
As a fun test, try the following: echo `find /usr -type f` vs find /usr -type f | xargs echo
|
|---|