## for -print (or ls or other newline-delimited names) find ... -print | perl -pi.bak -e 'BEGIN { chomp(@ARGV = <STDIN>) } s/ +foo/bar/g' ## for -print0 (safer when names may contain newline) find ... -print0 | perl -pi.bak -e 'BEGIN { local $/ = "\0"; chomp(@AR +GV = <STDIN>) } s/foo/bar/g'
In reply to xargs functionality for inplace editing by merlyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |