Bell 32V development
[unix-history] / usr / lib / learn / editor / L36.1a
CommitLineData
fed84c9b
TL
1#print
2So far all the special characters in the substitute command
3have been used in the left-hand expression, the one that
4is looked for in the line as it exists before the change.
5None of these characters are meaningful in the right-hand
6expression; for example,
7 s/ab/a./
8turn "ab" into "a." just as if "." were an ordinary letter.
9But there is one character that is special on the right
10side of a substitution, which is '&'. The ampersand
11is replaced by whatever text is being replaced. In
12 s/the/&m/
13the string "the" is turned into "them" because the '&' is
14replaced by "the".
15In this directory there is a file 'text'; on the third line,
16change the word 'dog' into 'dogs'; then rewrite the file
17and say "ready".
18#create Ref
19cat
20mouse
21dogs
22rat
23#create text
24cat
25mouse
26dog
27rat
28#user
29#cmp text Ref
30#log
31#next
3237.1a 10
3337.2a 6