10.0;s (substitute) *DM*, revision 1.0, 87/12/23
s (substitute) substitute all occurrences of matched string in defined range
usage: [range s [/string1/string2]
DESCRIPTION
The s command substitutes one literal string for a string described by a
regular expression over a defined text range. The command does not move
the cursor or the window, but does update the window when the
substitution is completed. Strings used with this command are also saved
for later use (see below).
All substitutions are case sensitive, unlike searches, which ignore case
unless told otherwise. You cannot disable substitution case sensitivity.
ARGUMENTS
If you do not specify an argument, the previous substitution is repeated
from the current cursor position to the end of the line.
range (optional)
Specify the range of text in which substitution is to be
made.
Default if omitted: use the current cursor position to
end of line
string1 (optional)
Specify the string to be replaced in the form of a regular
expression. If you omit this argument but use the opening
delimiter (/) (for example, s//string2/), string1 defaults
to the string used in the last search operation. If you
also omit the delimiter (for example, s/string2/), string1
defaults to the string used in the last substitution
operation.
Default if omitted: see above
string2 (optional)
Specify a literal replacement string. (This is not a
regular expression). You can use an "&" to denote
string1. If string1 is present, you must specify string2.
Default if omitted: repeat the last substitution command
EXAMPLES
Move to the first character in the pad, place a mark, and move to the
last character in the pad.
<CMD> s/Fielding/Tom Jones/
Replace the string "Fielding" with "Tom Jones" throughout
the marked range (in this case, the entire pad).
<CMD> s/Tom/& Jones/
Replace "Tom" with "Tom Jones". Because you did not mark
or specify a range, the replacement takes effect from the
current cursor position to the end of the line.
SEE ALSO
More information is available. Type the following at an Aegis shell
prompt:
help dm range For details about text editing ranges
help dm commands For a list of other pad editing commands
help patterns For details about regular expressions