[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Limits of grep?





Shaul Karl wrote:

> Then xargs won't work either, will it?
>

xargs has flags -n , -l , -s to limit amount od args xargs execs each time.
Thus, having find . -name "*"  | xargs -n 500  , and assuming that find will return
654 file names, xargs will run _twice_, one time with 500 args, second time with 154

However, more elegant (IMHO) solution is not to use find and xargs at all, but
instead use :

ls  | while read file_name ; do grep pattern $filename ; done
(sh  syntax used )

> =================================================================
> To unsubscribe, send mail to linux-il-request@linux.org.il with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail linux-il-request@linux.org.il

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il