#!/bin/bsh
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# cmdtext720 src/cmdtext/usr/bin/proff/proff.sh 1.6 
#  
# Licensed Materials - Property of IBM 
#  
# COPYRIGHT International Business Machines Corp. 1989,2007 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
# @(#)60      1.6  src/cmdtext/usr/bin/proff/proff.sh, cmdtext, cmdtext720 3/30/07 03:27:05
#
# COMPONENT_NAME: (CMDTEXT) Text Formatting Services
#
# FUNCTIONS:
#
# ORIGINS: 27
#
# (C) COPYRIGHT International Business Machines Corp. 1989
# All Rights Reserved
# Licensed Materials - Property of IBM
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
#
# 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1986
# LICENSED MATERIALS - PROPERTY OF IBM
# REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
#
#$Header:proff.sh 9.0$
#$ACIS:proff.sh 9.0$
#$Source: /ibm/acis/usr/src/ibm/proff/RCS/proff.sh,v $
#
# proff  [-t] [-Pxx] [-Lp] [nroff parameters]
#
# drive nroff commands and filters
#	for IBM Proprinters, IBM Quitwriter III and IBM Quickwriters. 
#  -t  send output to standard out
#  -Lp pass parameter p to qprt -dp
#  -Pxx use printer xx 
#
nrdrv="-Tppds"
printer=""
printcmd="qprt"
lpoptions=""
options="-rb3"

for i
do
	case $i in

	"-t")
		printcmd=""
		printer=""
		;;

	-P*)
		printer=$i
		;;

	-L*)
		lpoptions="$lpoptions `echo $i | \
			 /usr/bin/sed -e 's;-L;;' `"
		;;

	*)
		options="$options $i"
		;;
	esac
done
if [ $printcmd ]; then
	/usr/bin/nroff $nrdrv $options | /usr/bin/qprt -dp  $lpoptions $printer 
else
	/usr/bin/nroff $nrdrv $options
fi
