blob: dafb343cd45e4b873bd824b9236b801f4acdcc93 (
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
31
32
33
34
35
36
37
38
39
40
41
42
|
#print
Once in a while you want to add text just before
a certain line, rather than just after it. For this purpose
there is a command 'i' (insert) which is just like 'a'
except that the new material goes before the addressed line,
instead of after it. For example,
3i
is the same as
2a
Try this sequence, which prints the editor buffer before
and after the insertion, to see what happens.
ed cars
1,$p
3i
lincoln
chevrolet
.
1,$p
w
q
ready
#create Ref
ford
mercury
lincoln
chevrolet
buick
pontiac
oldsmobile
#create cars
ford
mercury
buick
pontiac
oldsmobile
#user
#cmp cars Ref
#log
#next
18.2c 7
18.3a 3
|