in reply to Re^3: One-line shell script for find and replace
in thread One-line shell script for find and replace
This simply isn't true. Read the docs.You're perfectly right. I knew but just forgot it. Indeed this is the reason why at some time I got used to do stuff like
find ./ | xargs perl -e'print "\n@ARGV"'
Should output one line with all of the arguements sent to perl.
whenever I suspected that the argument list may have been too long. (Now I generally stick with -exec.)find . -type f | while read f; do stuff with $f; done
Alternativly, just for the sake of putting this out there, this can be done without xargsIndeed. It was me to point this out in the first place, as you can see in the post you're replying to.
find ./ -exec perl -e'print "\n@ARGV" {} \;
But this would execute numerous copies of perl.
But fear not for find hsa an altnative syntax!Interesting. This I authentically didn't know. Of course it's all out there in the manpages, I guess. But generally you learn "this kinda things" as people tell you about them...
find ./ -exec perl -e'print "\n@ARGV"' {} +
Which is also probably the best way to acomplish this task.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: One-line shell script for find and replace
by eyepopslikeamosquito (Archbishop) on Oct 05, 2005 at 13:15 UTC |