How to add line numbers to a text file?

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Sat Dec 1 05:01:44 AEST 1990


In article <6826 at uceng.UC.EDU> dmocsny at minerva.che.uc.edu (Daniel Mocsny) writes:
> My question to all of you, however, is this: faced with the need to
> number a text file from a shell script, how would you do it? I'm
> kind of curious to see the variety of approaches possible. Would you
> use C, awk, perl, sed, sh, cat, echo, expr, and/or dd?

grep -n .*

---Dan



More information about the Comp.unix.questions mailing list