.\" Process this file with
.\" groff -man -Tascii msrp.1
.TH msrp 1 "DEC 2007" Linux "User Manuals"
msrp \- search and replace file contents and metadata recursively.
.B msrp searchpat repstr [-cdfiqsw] [--svn | --hg] [file1 | dir1/] [file2 | dir2/]...
reads in one or more file or directory arguments and applies a
regular-expression based global transformation. It searches for searchpat
as a Perl 5 compatible regular expression and substitutes repstr for
it for all listed arguments that follow. msrp applies the substitution
to both the contents of files as well as the filenames themselves.
If a filename is changed by a substitution, then the file is renamed to
reflect the new value. This type of renaming is useful when using
filenames that are also used in program source code text and both must
be kept consistent together. If a directory argument is given, that
directory is recursively traversed unless the \-s option is given.
Directories can also be renamed and all three modes of operation are
enabled by default. File contents, file names, and directory names are
all transformed by the given regular expression substitution. Note that
subdirectories starting with . are not entered recursively unless the
--dot-paths option is specified.
If a numbered back-substitution group is wanted, simply use a backslash
followed by a decimal digit to refer to a captured group in the replacement
string. Capture group 0 represents the entire match string.
If a file is unchanged by a given regular expression then it will not have
its modification time updated by msrp. Only files that are actually changed
are touched. The following options can customize behavior:
disable file contents transformation
disable directory renaming transformation
disable filename renaming transformation
perform case-insensitive matching
quiet mode, with no extra status messages
do not recursively enter subdirectories
enable word-boundary constraint. This means the matched expression must
begin and end with a word boundary, as in perl \\b regexp notation.
\fB\--hg or --mercurial \fR
enable Mercurial renaming.
\fB\--svn or --subversion \fR
enable Subversion renaming.
Rename all files in the current directory recursively searched that end
with the extension .html and rename them to .htm without touching
file contents or directories:
msrp \-c \-d \(aq(.*)html$\(aq \(aq\\1htm\(aq .
Copy olddebian/ dir to debian/ while changing oldpkgname to newname in
files, directories, and filenames:
cp -rv olddebian/ debian && msrp oldpkgname newname debian
Normalize extension case of .c files so .C becomes .c:
msrp \-c \-d \-i \(aq(.*)\\.c$\(aq \(aq\\1.c\(aq .
Rename vector to zector in Subversion:
msrp --svn vector zector .
No environment variables.
Please report bugs to the Debian BTS.
Rudi Cilibrasi <email@example.com>