1RPL(1) BSD General Commands Manual RPL(1)
2
4 rpl — replace strings in files
5
7 rpl [-LhiwbqvsRepfdt] [-xSUFFIX] ⟨old_string⟩ ⟨new_string⟩
8 ⟨target_file ...⟩
9
11 Basic usage is to specify two strings and one or more filenames or direc‐
12 tories on the command line. The first string is the string to replace,
13 and the second string is the replacement string.
14
15 -h, --help
16 A short help text.
17
18 -L, --license
19 Show the license and exit.
20
21 -xSUFFIX
22 Search only files ending with SUFFIX, e.g. “.txt”. May be spec‐
23 ified multiple times.
24
25 -i, --ignore-case
26 Ignore the case of old_string.
27
28 -w, --whole-words
29 Make old_string match only on word boundaries.
30
31 -b, --backup
32 Move the original files to filename~ before replacing them.
33
34 -q, --quiet
35 Quiet mode.
36
37 -v, --verbose
38 Verbose mode.
39
40 -s, --dry-run
41 Simulation mode, no files are changed.
42
43 -R, --recursive
44 Recurse into subdirectories.
45
46 -e, --escape
47 Expand escape sequences in old_string and new_string. Examples
48 of escape sequences are ‘\n’ (new-line), ‘\t’ (tab), ‘\x42’
49 (hexadecimal number 42), ‘\033’ (octal number 033).
50
51 -p, --prompt
52 Prompt for confirmation before replacing each file.
53
54 -f, --force
55 Ignore errors when trying to restore permissions and file owner‐
56 ship.
57
58 -d, --keep-times
59 Keep modification times when replacing files.
60
61 -t, --use-tmpdir
62 Use a temporary directory for storing temporary files, usually
63 the value of the environment variable TMPDIR. The default is to
64 put temporary files in the same directory as the file being modi‐
65 fied.
66
67 -a, --all
68 Do not ignore files and directories starting with .
69
71 An effort has been made to make the program behave as much as the origi‐
72 nal rpl as necessary. Where it has been possible to make improvements,
73 improvements have been made. This implementation lacks many of the bugs
74 in the original.
75
77 Replace all occurences of “F” (on word boundaries) with “A” in all text
78 files under the grades/ directory:
79 $ rpl -Rwd -x'.txt' 'F' 'A' grades/
80
82 find(1), sed(1).
83
85 This program was written for Debian as a free replacement for the non-
86 free rpl program by Joe Laffey.
87
89 Göran Weinholt <weinholt@debian.org>.
90
91Debian July 31, 2005 Debian