gres pattern substitution [file ...]
gres reads input from each argument file and looks for all lines matching pattern. The pattern is an extended regular expression. See regexp for further information. For each input line matched, gres replaces all occurrences of matching strings with the replacement string substitution. It then writes its results to the standard output.
If you do not specify any files on the command line, gres reads the standard input.
As is the case for the substitution command in the ed text editor, the substitution string may contain the following shorthand notations:
The character & in the substitution string is replaced by the entire string that matched the regular expression pattern.
This notation is identical in meaning to &.
The number d must be a single digit between 1 and 9. If the pattern contains any portions enclosed by the () characters, the string \d is replaced by the text matched by the dth parenthesized portion of pattern. Parenthesized expressions are numbered by counting ( characters from the left.
To circumvent the special meaning of any of these characters, put \ in front of the special character. For example, to substitute a \ character, type \\.
This is a filter to switch political allegiance:
gres 'democrat(ic)?' republican
Possible exit status values are:
gres found at least one match for pattern and made the desired substitution.
gres found no matches for pattern.
Failure due to any of the following:
Windows 2000. Windows XP. Windows Server 2003. Windows Vista. Windows 7. Windows Server 2008. Windows 8. Windows Server 2012.
This is really a simple subset of the sed command.
MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
MKS Toolkit 9.5 Documentation Build 3.