Commit | Line | Data |
---|---|---|
fed84c9b TL |
1 | |
2 | Remember we said that you didn't have to know the | |
3 | number of the last line, because '$' could | |
4 | always be used for that. What if you want to know | |
5 | how long the file is? Well, the editor command | |
6 | $= | |
7 | will tell you what '$' is set to, i.e. the number of | |
8 | lines in the file. You can find the number of lines in | |
9 | any file, then, by editing it and then typing "$=". | |
10 | (You then must leave the editor with the usual w,q). | |
11 | How many lines are there in file 'henry'? You may want to check | |
12 | by listing the file with "cat" as well as by using "$=" | |
13 | in the editor. Don't forget to leave the editor with | |
14 | the usual 'w', 'q'; eventually, type "answer N" | |
15 | where N is the number of lines. | |
16 | #create henry | |
17 | Murray Hill | |
18 | Holmdel | |
19 | Whippany | |
20 | Madison | |
21 | Piscataway | |
22 | Chester | |
23 | Warren | |
24 | #copyin | |
25 | #pipe | |
26 | #user | |
27 | #unpipe | |
28 | #uncopyin | |
29 | #match 7 | |
30 | #log | |
31 | #next | |
32 | 14.1a 10 |