(h)xprint.sh

        0001|#sample shell to format and print text-file using xprint
        0002|#########################
        0003|#  xprint parm          #
        0004|#-ne:skip output escape sequence cmd
        0005|#-nu:skip output formfeed cmd
        0006|#-q-:output to stdout
        0007|#-l :line count/page
        0008|#-c :char count/line
        0009|#########################
        0010|#  mpage  parm          #
        0011|#-1 :1 page/sheet
        0012|#-b :paper type
        0013|#-o :toggle draw outline box(check current setting by "mpage -x")
        0014|#-L :line count/page
        0015|#-W :char count/line
        0016|#-m30b:bottom margin is 30 point
        0017|#########################
        0018|qopt=0
        0019|for parm in $@
        0020|do
        0021|    case "$parm" in
        0022|    -[Qq]*)    qopt=1;;
        0023|    esac
        0024|done
        0025|#########################
        0026|COLXP=105
        0027|LINEXP=60
        0028|COLMPAGE=`expr $COLXP + 7`          #for lineno field width
        0029|LINEMPAGE=`expr $LINEXP + 3`        #for header/trailer lines
        0030|#########################
        0031|if  [ $qopt -eq 1 ]
        0032|then
        0033|    xprint -ne -nu -l$LINEXP -c$COLXP $1 $2 $3 $4 $5 $6 $7 $8 $9
        0034|else
        0035|    xprint -ne -q- -nu -l$LINEXP -c$COLXP $1 $2 $3 $4 $5 $6 $7 $8 $9 | mpage -1 -bA4 -o -m30b -W$COLMPAGE -L$LINEMPAGE | lpr
        0036|fi
1