BSD 4_1_snap development
[unix-history] / usr / lib / learn / editor / L8.2a
CommitLineData
3eb5d546
C
1#print
2You can give addresses involving simple arithmetic
3to move around in the file. For example,
4 3+1p
5is the same as
6 4p
7in the editor. Now that's not interesting, but
8if the current line (".") is line 3, then
9 .+1p
10is also 4p; it prints the next line. For example,
11you can print the 3rd and 4th lines of this file
12using
13 3p
14 .+1p
15 w
16 q
17where "3p" prints the third line, as usual,
18and then ".+1p" prints the next or fourth line.
19Try that. Type "ready" when done.
20#create Ref
21caslon
22century schoolbook
2386
24#create file
25baskerville
26bodoni
27caslon
28century schoolbook
29futura
30helvetica
31news gothic
32times roman
33#copyout
34#pipe
35ed file
36#user
37#unpipe
38#uncopyout
39tail -3 .ocopy >X1
40#cmp Ref X1
41#log
42#next
438.2b 5
449.1a 10