|
|
1.1 ! root 1: #print ! 2: You can of course combine the various sorts ! 3: of line addresses we have been using. ! 4: Suppose the last line is line 6; then $ is ! 5: line 6, and $-1 is line 5. Thus $-1 is the ! 6: next to last line, and ! 7: 1,$-1p ! 8: prints all but the last line of a file. Again, ! 9: I'll put you in the editor: print the last three lines ! 10: of the file. End with the usual w, q, and ready. ! 11: #create Ref ! 12: : Gil Hodges ! 13: Yogi Berra ! 14: Roy McMillan ! 15: :"file" 6 lines, 89 characters ! 16: #create file ! 17: New York Mets Managers ! 18: Casey Stengel ! 19: Wes Westrum ! 20: Gil Hodges ! 21: Yogi Berra ! 22: Roy McMillan ! 23: #copyout ! 24: #pipe ! 25: ex +'set prompt noopt open' file ! 26: #user ! 27: #unpipe ! 28: #uncopyout ! 29: tail -4 .ocopy >X1 ! 30: #cmp X1 Ref 4 ! 31: #fail ! 32: I hope you realized the addresses had to be ! 33: $-2,$p ! 34: to get the last three lines. ! 35: #log ! 36: #next ! 37: 11.1a 10 ! 38: 11.2a 5
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.