BSD 3 development
[unix-history] / usr / lib / learn / editor / L37.2a
CommitLineData
fd15fd37
BJ
1#print
2A range of line numbers can be used with the substitute
3command as with the print command. For example,
4
5$-4,$s/cat/&s/p
6
7will change "cat" into "cats" on the last five lines of
8a file. In this directory there is a file "cliche"
9containing a number of instances of the word "dog"; change
10the instances of "dog" in the first five lines to "dogs".
11Then rewrite the file and type "ready".
12#create Ref
13dogs tired
14sick as a dogs
15dogs eared
16wouldn't send a dogs out on a night like this
17every dogs has his day
18dog gone
19#create cliche
20dog tired
21sick as a dog
22dog eared
23wouldn't send a dog out on a night like this
24every dog has his day
25dog gone
26#user
27#cmp cliche Ref
28#log
29#next
3037.2b 5