replaceit(1) A quick, light and effective text replacement tool


replaceit --input=<filename> [--wholeline] "<replace>" "<with>" [["[+-]<string to be present>"  | "<-string to be non-present>"] ...]


ReplaceIt is a quick, light and effective replacement to the combination of sed/awk/grep/head/tail and other such shell utilities, as well as being quicker in startup (at least) than an equivalent Perl solution.

ReplaceIt has various rules which can be used to enhance its abilities when negotiating tricky sections of text, whilst searching for the right one to replace, these include [ on same line ] string inclusion dependence, exclusion dependence, pre-existence, post-existence.

NOTE: ReplaceIt is a line-by-line file parser, so, it cannot (at this point) process across multiple ] terminated lines.


Name of file to which the replacements should be applied
Replace the whole line with <with>, rather than partial replacements
String to search for and replace
String to substitute for <replace>
<[+-]string to be present>
A string which should also be detected on the line to be tested
<-string to be missing>
A string which should NOT be present on the line to be tested
<}string to appear after>
This string must appear AFTER the section to replace
<{string to appear before>
This string must appear BEFORE the section to replace


replaceit --input=myfile.c "_MY_DEFINE" "_YOUR_DEFINE" "-#define" "};"


replaceit was written by Paul L Daniels <[email protected]>.

This manual page was written by Jonathan Wiltshire <[email protected]>, for the Debian project (but may be used by others).