Wednesday, April 9, 2008

Perl on the fly

To replace string in a file on the fly using perl simply enter in the command line the following:

% perl -p -i -e 's/one/two/g' file

The script simply replace all entries of "one" with "two".




No comments: