#!/bin/ksh
# Script name: numberit
# Example 10.113

# Put line numbers on all lines of memo
if (( $# < 1 )) 
then
    print "Usage: $0 filename " >&2
    exit 1
fi

integer count=1	 	#Initialize count
cat $1 | while read line	#Input is coming from memo
do
    (( count == 1 )) && print "Processing file $1..." > /dev/tty 
    print $count $line
    (( count+=1 ))
done > tmp$$	#Output is going to a temporary file
mv tmp$$ $1
