The base options for POSIX 2 lp and friends doesn't include a line number.
If you find your printer in /etc/lp/interface (I think that's where it is in Linux, someone correct me), you can see what options your printer driver supports. This is totally installation dependent, nothing else.
Then if you find one that meets your needs
Code:
lp -o option_whatever <filename>
If that doesn't work for you try:
Code:
#!/bin/ksh
# prline
# add line numbers
# $1 = file name
#
let line=0
while read text
do
let line=line+1
printf "%5d " $line
printf "%s\n" $text
done < $1
usage: prline oldfilename > newfilename
then lp the newfilename