Sorry, what do you think
vim $(grep -lr foo | xargs)
is doing? Assuming a missing directory after the `foo' why can't it just be vim $(grep -lr foo .)
I don't see that xargs's default behaviour is adding anything.For
find . -name foo_fn exec sed -i s/foo_fn/bar_fn/g '{}' \;
you may find -exec's + of use. The above has the fork/execve overhead for each file found. find -name '*.[ch]' -exec sed -i 's/\<foo\>/bar/g' {} +