DOKK / manpages / debian 12 / rrep / rrep.1.en
RREP(1) General Commands Manual RREP(1)

rrep - replace patterns in files.

rrep [OPTIONS] PATTERN REPLACEMENT [FILE...]

The rrep utility searches input FILEs for matches to a given PATTERN and replaces those matches by a given REPLACEMENT. The pattern is, by default, a basic regular expression. The replacement string may contain special characters to refer to portions of the matched pattern.

Binary files are, by default, ignored. A file is regarded as binary if it contains the null character.

PATTERN is interpreted as an extended regular expression (ERE).
PATTERN and REPLACEMENT are interpreted as fixed strings, not as regular expressions or escape sequences.
Each directory that is given on the command line is processed recursively. Files and sub-directories starting with the . character are, by default, ignored.
Only files are processed that match the pattern FILE_PATTERN, except for files that are specifically given on the command line. *, ?, and [...] can be used as wildcards in FILE_PATTERN. Wildcards and backslash characters can be quoted with \.
Files that match the pattern FILE_PATTERN will be skipped, except for files that are specifically given on the command line (using wildcard matching as described under --include).
Directories that match PATTERN will be skipped, except for files that are specifically given on the command line (using wildcard matching as described under --include).
Print the version number of rrep.
Override default backup suffix. This option implicitly activates backups.
Files and sub-directories starting with the . character in recursively processed directories (see --recursive) are processed as well.
Backup before overwriting files. The backup files are written into the directory of the original file. Equivalent to using --backup=existing.
Like -b but accepts a version control argument. The file name of the backup file is appended by a ~ character. The backup suffix is ~, unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:
none, off never make backups
(even if --backup is given)
numbered, t make numbered backups
existing, nil numbered if numbered backups exist, simple
otherwise
simple, never always make simple backups
Do not ignore binary files. A file is regarded as binary if it contains the null character \0.
The replacement is just simulated. No file is actually modified.
Use PATTERN for matching. This option can be used to specify a pattern beginning with -.
Display a help message that describes the command line options and exit afterwards.
Case distinctions in PATTERN are ignored.
The original access and modification times of files and directories are restored after processing.
Use REPLACEMENT for substitution.
Each time before a file is modified the user is prompted and can cancel the modification.
All normal output messages are suppressed.
All error messages are suppressed.
Only those matches of PATTERN are replaced that match whole words.
Only those matches of PATTERN are replaced that match whole lines.

Exit status is 1 if any error occurs, 0 otherwise.

Written by Arno Onken.

If you find a bug in rrep, please send electronic mail to <asnelt@asnelt.org>. Include the version number, which you can find by running rrep --version. Also include in your message the output that the program produced and the output you expected.

If you have other questions, comments or suggestions about rrep, contact the author via electronic mail to <asnelt@asnelt.org>. The author will try to help you out, although he may not have time to fix your problems.

Copyright 2011, 2013, 2019, 2022 Arno Onken

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

find(1), grep(1), sed(1), xargs(1), regex(7).

The full documentation for rrep is maintained as a TeXinfo manual. If the info and rrep programs are properly installed at your site, the command

info rrep

should give you access to the complete manual.

rrep 1.3.7 User Commands