.Dd July 31, 2005 .Os Debian .Dt RPL 1 . .Sh NAME .Nm rpl .Nd replace strings in files . .Sh SYNOPSIS .Nm rpl .Op Fl LhiwbqvsRepfdt .Op Fl x Ns Ar SUFFIX .Ao Ar old_string Ac Ao Ar new_string Ac .Bk .Ao Ar target_file ... Ac .Ek . .Sh DESCRIPTION Basic usage is to specify two strings and one or more filenames or directories on the command line. The first string is the string to replace, and the second string is the replacement string. .Bl -tag -width Ds .It Cm \-h, \-\-help A short help text. .It Cm \-L, \-\-license Show the license and exit. .It Cm \-x Ns Ar SUFFIX Search only files ending with .Ar SUFFIX , e.g. .Dq .txt . May be specified multiple times. .It Cm \-i, \-\-ignore\-case Ignore the case of .Ar old_string . .It Cm \-w, \-\-whole\-words Make .Ar old_string match only on word boundaries. .It Cm \-b, \-\-backup Move the original files to .Pa filename~ before replacing them. .It Cm \-q, \-\-quiet Quiet mode. .It Cm \-v, \-\-verbose Verbose mode. .It Cm \-s, \-\-dry\-run Simulation mode, no files are changed. .It Cm \-R, \-\-recursive Recurse into subdirectories. .It Cm \-e, \-\-escape Expand escape sequences in .Ar old_string and .Ar new_string . Examples of escape sequences are .Sq \en (new-line), .Sq \et (tab), .Sq \ex42 (hexadecimal number 42), .Sq \e033 (octal number 033). .It Cm \-p, \-\-prompt Prompt for confirmation before replacing each file. .It Cm \-f, \-\-force Ignore errors when trying to restore permissions and file ownership. .It Cm \-d, \-\-keep\-times Keep modification times when replacing files. .It Cm \-t, \-\-use\-tmpdir Use a temporary directory for storing temporary files, usually the value of the environment variable .Ev TMPDIR . The default is to put temporary files in the same directory as the file being modified. .It Cm \-a, \-\-all Do not ignore files and directories starting with . .El . .Sh IMPLEMENTATION NOTES An effort has been made to make the program behave as much as the original .Nm rpl as necessary. Where it has been possible to make improvements, improvements have been made. This implementation lacks many of the bugs in the original. . .Sh EXAMPLES Replace all occurences of .Dq F (on word boundaries) with .Dq A in all text files under the grades/ directory: .Dl $ rpl \-Rwd \-x'.txt' 'F' 'A' grades/ . .Sh SEE ALSO .Xr find 1 , .Xr sed 1 . . .Sh HISTORY This program was written for Debian as a free replacement for the non-free .Nm rpl program by Joe Laffey. . .Sh AUTHORS .An "G\[:o]ran Weinholt" Aq weinholt@debian.org .