in reply to Line numbering

perl -pe '$_ = "$.: $_"' your_file >your_new_file
Update: I missed to skip the empty lines:
perl -pe '$_ = /\S/ ? ++$q .": $_" : ""' in >out
Boris

Replies are listed 'Best First'.
Re^2: Line numbering
by Jasper (Chaplain) on Oct 04, 2004 at 12:43 UTC
    As an alternative, you can decrement $. with no ill effects, apart from forgetting where you actually are. :)
    perl -pe '/\S/ ? s/^/$.: / : --$.'