One of my Fedora feeds had an announcement of the Rawhide version of a nifty little utility called rpl. Here’s its help screen:
Usage: rpl [options] old_string new_string target_file(s)
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-L, --license show the software license
-x SUFFIX specify file suffix to match
-i, --ignore-case do a case insensitive match
-w, --whole-words whole words (old_string matches on word boundaries only)
-b, --backup make a backup before overwriting files
-q, --quiet quiet mode
-v, --verbose verbose mode
-s, --dry-run simulation mode
-R, --recursive recurse into subdirectories
-e, --escape expand escapes in old_string and new_string
-p, --prompt prompt before modifying each file
-f, --force ignore errors when trying to preserve permissions
-d, --keep-times keep the modification times on modified files
-t, --use-tmpdir use $TMPDIR for storing temporary files
-a, --all do not ignore files and directories starting with .
So, basically rpl is a sed-like tool that can optionally recurse directories. I quickly did a yum install rpl on my Fedora laptop. rpl is a python script, so it should work anyplace that has python installed.
This is what I like about Linux and Unix; I’ve been using both for years, and there are still neat little discoveries like this to be made. This beats the tar out of doing a find and exec’ing sed for each file of interest.
-k-




![Validate my Atom 1.0 feed [Valid Atom 1.0]](http://www.quietvoice.org/wp-images/valid-atom.png)