Ever want line numbers
appended to a file. Here
is a short script.
awk '{no=no+1; printf"%d : %s", no, $0}' filename > filename.out
Another shorter but not
necessary elegant method
is:
grep -n . filename > filename.out
filename is the original file
filenmae.out is the file with
line numbers appended at the
beginning of each line
This tip generously supported by: pradeep@unixguru.zzn.com
NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.