On Mon, Feb 21, 2011 at 05:05:56PM +0100, Paul de Weerd wrote: > It does not when there's only one file matching the find-experssion > (which is unclear when using find | xargs grep). > > [weerd@despair] $ find . -name pi.c > ./pi.c > [weerd@despair] $ find . -name pi.c | xargs grep main > main(int argc, char *argv[]) { >
Yes, i think there is another exception when you accidently hit the maximum number + 1 of arguments for one invocation, by default 5001 files then xargs would execute: grep main <5000 files> and the last file as: grep main <one file> (and thus not printing the filename)