BSD 4_1_snap development
[unix-history] / usr / lib / learn / editor / L8.1a
CommitLineData
3eb5d546
C
1#print
2To move around, you can use simple arithmetic
3when specifying what to print. For example,
4 3+1p
5is the same as
6 4p
7as an editor command. Now that's not very interesting;
8but if the '.' current line pointer is line 3,
9then using
10 .+1p
11instead of 4p is helpful.
12For example, print the 3rd and 4th
13lines of the familiar file using first "3p" to
14get to line 3 and then ".+1p" to print the next line.
15End as usual with w, q, and ready.
16#create Ref
17thomas jefferson
18james madison
1991
20#create file
21george washington
22john adams
23thomas jefferson
24james madison
25james monroe
26john quincy adams
27#copyout
28#pipe
29ed file
30#user
31#unpipe
32#uncopyout
33tail -3 .ocopy >X1
34#cmp Ref X1
35#log
36#next
379.1a 10
388.1b 7