Commit | Line | Data |
---|---|---|
3eb5d546 C |
1 | |
2 | So far I have always put you into the editor. | |
3 | How do you get there yourself? The main command | |
4 | interpreter (the shell) recognizes | |
5 | ed | |
6 | as the name of the editor. (On some systems, | |
7 | it is also called "e", which is a useful abbreviation.) | |
8 | You can also say | |
9 | ed file1 | |
10 | which put you in the editor with the current file | |
11 | "file1". So, for example, you can print the | |
12 | last line of a file with | |
13 | ed NAME | |
14 | $p | |
15 | w | |
16 | q | |
17 | where NAME is the name of the file. | |
18 | ||
19 | In this directory is a file named "file45". Print the | |
20 | last line of it, and then exit as above. | |
21 | #create Ref | |
22 | This file contains nothing | |
23 | of great importance and | |
24 | you should not be printing | |
25 | these lines because the only | |
26 | line that you were asked for | |
27 | was | |
28 | this line, the last line. | |
29 | #create file45 | |
30 | This file contains nothing | |
31 | of great importance and | |
32 | you should not be printing | |
33 | these lines because the only | |
34 | line that you were asked for | |
35 | was | |
36 | this line, the last line. | |
37 | #copyout | |
38 | #pipe | |
39 | #user | |
40 | #unpipe | |
41 | #uncopyout | |
42 | grep last .ocopy >X1 | |
43 | tail -1 Ref >X2 | |
44 | #cmp X1 X2 | |
45 | #log | |
46 | #next | |
47 | 11.2b 10 | |
48 | 12.2a 5 |