|
|
1.1 root 1: #print
2: You can give addresses involving simple arithmetic
3: to move around in the file. For example,
4: 3+1p
5: is the same as
6: 4p
7: in the editor. Now that's not interesting, but
8: if the current line (".") is line 3, then
9: .+1p
10: is also 4p; it prints the next line. For example,
11: you can print the 3rd and 4th lines of this file
12: using
13: 3p
14: .+1p
15: w
16: q
17: where "3p" prints the third line, as usual,
18: and then ".+1p" prints the next or fourth line.
19: Try that. Type "ready" when done.
20: #create Ref
21: :caslon
22: :century schoolbook
23: :"file" 8 lines, 86 characters
24: #create file
25: baskerville
26: bodoni
27: caslon
28: century schoolbook
29: futura
30: helvetica
31: news gothic
32: times roman
33: #copyout
34: #pipe
35: ex +'set prompt noopt open' file
36: #user
37: #unpipe
38: #uncopyout
39: tail -3 .ocopy >X1
40: #cmp Ref X1 3
41: #log
42: #next
43: 8.2b 5
44: 9.1a 10
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.