For changing all occurrences of a several expression in a file, Perl with command line options can be very helpful. The following shows a pretty general example:
$> perl -i.bck -ep 's/search_term/replace_with/g' filename
The above command will check the "filename" file and, replace all occurences of "search_term" with the "replace_with" term. "-i" option tells Perl to backup the file with a ".bck" extension before any operation.
No comments:
Post a Comment