substitute lines in a file or append if not
is shipped to remote machines by
provide a standard method of modifying configuration parameters within a file.
Two modes of operation are supported: line substitution and block replacement.
line replacements are defined by the flags
, while the
content for a text block is provided on STDIN.
The arguments for line subsitution are as follows:
- Append line if the pattern is not found.
- A regular expression matching the line to replace.
- The replacement text for a matching line. Newlines are not
permitted as part of the replacement string.
When updating a block of text,
define the beginning and ending
utility exits with one of the following
- Target file was updated
- No changes were made, or an error occurred
- Incorrect parameters
- File not found