Commit | Line | Data |
---|---|---|
00b28f22 TL |
1 | |
2 | How does the editor choose a line to print? | |
3 | It always remembers a 'current line', which | |
4 | is the last line of the file originally, | |
5 | but you can choose any line you want. The command | |
6 | ||
7 | 3p | |
8 | ||
9 | prints the third line of the file, for example. | |
10 | And | |
11 | ||
12 | 1p | |
13 | ||
14 | prints the first line. Note that is the digit one | |
15 | there, not the letter l, no matter how much alike they | |
16 | look. I'll put you into the editor with the | |
17 | file listed below: print the first line, | |
18 | then type 'w', 'q' and 'ready' as usual. | |
19 | #create Ref | |
20 | george washington | |
21 | 91 | |
22 | #create file | |
23 | george washington | |
24 | john adams | |
25 | thomas jefferson | |
26 | james madison | |
27 | james monroe | |
28 | john quincy adams | |
29 | #print file | |
30 | #copyout | |
31 | #pipe | |
32 | ed file | |
33 | #user | |
34 | #unpipe | |
35 | #uncopyout | |
36 | tail -2 .ocopy >X2 | |
37 | #cmp Ref X2 | |
38 | #log | |
39 | #next | |
40 | 6.2b 5 |