Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!gatech!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!dcl-cs!gdt!ccsdhd From: ccsdhd@gdt.bath.ac.uk (Dennis Davis) Newsgroups: comp.unix.questions Subject: Re: How to add line numbers to a text file? Message-ID: <1990Dec6.144354.2848@gdt.bath.ac.uk> Date: 6 Dec 90 14:43:54 GMT References: <15248:Nov3018:01:4490@kramden.acf.nyu.edu> <18438:Nov3021:25:2590@kramden.acf.nyu.edu> Organization: Bath University Computing Services, Bath, England Lines: 40 Newsgroups: comp.unix.questions Subject: Re: How to add line numbers to a text file? Summary: Expires: References: <15248:Nov3018:01:4490@kramden.acf.nyu.edu> <18438:Nov3021:25:2590@kramden.acf.nyu.edu> Sender: Followup-To: Distribution: Organization: Bath University Computing Services, Bath, England Keywords: In article <18438:Nov3021:25:2590@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: . . . >(Yeah, that's it: echo 'set nu' >> ~/.exinit. :-) ) > >---Dan Nice to see someone suggesting the use of my favourite editor :-) However it isn't necessary to modify your .exrc startup file. A command line of the form: ex - -R +'set nu|1,$p|q' filename should suffice. Yes, I know it suffers from the disadvantages of (a) Being slow and inefficient. (b) Will only handle a limited size of file. (c) You can't tailor the output. but, what the heck, it's different :-) -- Dennis Davis JANET: D.H.Davis@UK.AC.BATH University of Bath UUCP: ...!mcsun!ukc!gdr!D.H.Davis Bath, BA2 7AY EARN/BITNET: D.H.Davis%uk.ac.bath@UKACRL England INTERNET: D.H.Davis%bath.ac.uk@nsfnet-relay.ac.uk