Re: Why xargs still call the command when there is no input?

2015-06-02 Thread Eric Blake
On 06/02/2015 04:02 PM, Peng Yu wrote: > The following command will call ls. But since there is no input, > shouldn't xargs quit without doing anything? Thanks. > > xargs -0 ls http://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html We have the -r extension precisely because sometime

Re: Why xargs still call the command when there is no input?

2015-06-02 Thread Peng Yu
On Tue, Jun 2, 2015 at 5:50 PM, Morgan Weetman wrote: > > Hi Peng, > > if you read the man page the behaviour is defined (note the "one or more > times"): > > - > xargs reads items > from the standard input, delimited by blanks (which can be protected > with double or singl

Re: Why xargs still call the command when there is no input?

2015-06-02 Thread Morgan Weetman
Hi Peng, if you read the man page the behaviour is defined (note the "one or more times"): - xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the command (defaul

Why xargs still call the command when there is no input?

2015-06-02 Thread Peng Yu
The following command will call ls. But since there is no input, shouldn't xargs quit without doing anything? Thanks. xargs -0 ls