in reply to Re: Find and Replace text script?
in thread Find and Replace text script?

avoiding xargs

Why spawn a copy of perl for each file?

$ find . -maxdepth 1 | xargs perl -le 'print "$$: my args: @ARGV"' 12390: my args: . ./bash ./rbash ./sh ./cat ./chgrp ./chmod ./chown ./ +cp [...]
$ find . -maxdepth 1 -exec perl -le 'print "$$: my args: @ARGV"' {} \; 12399: my args: . 12400: my args: ./bash 12401: my args: ./rbash 12402: my args: ./sh 12403: my args: ./cat 12404: my args: ./chgrp 12405: my args: ./chmod 12406: my args: ./chown 12407: my args: ./cp [...]

--
David Serrano

Replies are listed 'Best First'.
Re^3: Find and Replace text script?
by duckyd (Hermit) on Jul 14, 2006 at 23:22 UTC
    Generally, I don't care if I'm spawning a new copy of perl or not. It runs plenty fast either way