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