* Kapil Hari Paranjape <[EMAIL PROTECTED]> 2008-06-07
> On Sat, 07 Jun 2008, Masatran, R. Deepak wrote:
> > Aren't
> > 
> >     xargs foo
> > 
> > and
> > 
> >     xargs -i foo {}
> > 
> > supposed to be identical? Why do they act different?
> 
> Because they are not identical!
> 
> The first takes the white-space separated words from standard input
> and assigns them as ARG1, ARG2, ....
> and runs foo with _all_ these arguments.
> 
> The second takes _each_ white-space separated word from standard
> input and runs foo with ARG1 set to that word.

Eureka! I scanned the man page again and found a switch "-l" which forces
each input argument to be processed separately. Therefore, it is

    xargs -l foo

that is equivalent to

    xargs -i foo {}

Now onwards, I will always use "-l" with XArgs. Isn't XArgs the greatest
command on Unix!!

-- 
Masatran, R. Deepak <http://research.iiit.ac.in/~masatran/>


_______________________________________________
To unsubscribe, email [EMAIL PROTECTED] with 
"unsubscribe <password> <address>"
in the subject or body of the message.  
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to