[Techtalk] real life kewl text-processing and regexps samples
wanted
Daniel
lc-techtalk at nada.refused.cc
Sat Jan 10 14:29:36 EST 2004
On Sat, Jan 10, 2004 at 04:36:51AM +0100, Daniel wrote:
> find . -type f -print0 | xargs -0 grep "thing-to-find"
I have to correct that, shell programming is hard. :)
xargs calls the utility with a maximum number of arguments. The
default on my system is 5000. If find finds more than that, the
utility (grep) is called several times. So, in the case that find
finds 5001 files, and the last file matches, grep will not prefix
the filename to the result.
Solution:
find . -type f -print0 | xargs -0 grep "thing-to-find" /dev/null
-Daniel-
More information about the Techtalk
mailing list