in reply to Re: Search and replace within a file
in thread Search and replace within a file
I did some time comparison for both perl and sed and it turns out that sed has better performance$sed -i 's#uname#newname#' /etc/hosts/*
$time sed -i 's/sri/harry/' * sed -i 's/sri/harry/' * 0.00s user 0.01s system 37% cpu 0.016 total $time perl -pi -e 's/harry/sri/' perl -pi -e 's/harry/sri/' * 0.01s user 0.01s system 62% cpu 0.029 to +tal
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Search and replace within a file
by afoken (Chancellor) on May 12, 2012 at 07:55 UTC |