Commit | Line | Data |
---|---|---|
007f9fd0 BJ |
1 | |
2 | Changing a whole line with the 'c' command is a slow way | |
3 | to work when you only want to change a few letters. The 's' (substitute) | |
4 | command changes the letters within a line. For example, the command | |
5 | s/abc/def/ | |
6 | will change a line reading | |
7 | xxxabc | |
8 | into one reading | |
9 | xxxdef | |
10 | by replacing the string 'abc' with 'def'. Try the following sequence which | |
11 | alters the first line of the file 'test' within this directory: | |
12 | ||
13 | ed test | |
14 | 1p | |
15 | s/months/years/ | |
16 | 1p | |
17 | w | |
18 | q | |
19 | ready | |
20 | #create Ref | |
21 | Four score and seven years ago our | |
22 | fathers brought forth ... | |
23 | #create test | |
24 | Four score and seven months ago our | |
25 | fathers brought forth ... | |
26 | #user | |
27 | #cmp test Ref | |
28 | #log | |
29 | #next | |
30 | 30.2b 5 |