Commit | Line | Data |
---|---|---|
00b28f22 TL |
1 | |
2 | You may well ask how the editor knows which line to print. | |
3 | The editor keeps track of the 'current line', which | |
4 | is usually the last line you touched in any way. | |
5 | When you begin editing a file, for example, the | |
6 | current line is the last line. | |
7 | If you want to print any particular line, however, | |
8 | that is easy. For example, to print the 3rd line you say | |
9 | ||
10 | 3p | |
11 | ||
12 | To print the first line | |
13 | ||
14 | 1p | |
15 | ||
16 | (That's a one, no matter how much it looks like the letter "l".) | |
17 | Here is a file: I'll put you into the editor | |
18 | with that file as the 'current file' - print the 4th line, | |
19 | then type 'w', 'q', and 'ready' as usual. | |
20 | #create Ref | |
21 | james madison | |
22 | 91 | |
23 | #create file | |
24 | george washington | |
25 | john adams | |
26 | thomas jefferson | |
27 | james madison | |
28 | james monroe | |
29 | john quincy adams | |
30 | #print file | |
31 | #copyout | |
32 | #pipe | |
33 | ed file | |
34 | #user | |
35 | #unpipe | |
36 | #uncopyout | |
37 | tail -2 .ocopy >X2 | |
38 | #cmp Ref X2 | |
39 | #log | |
40 | #next | |
41 | 7.1a 10 |