
# UNISRC_ID: @(#)prn.sh	27.1	84/11/26  
# Script to pr files with nice headers.

# prn -d	document mode:
#		unnumbered, normal (not compressed) print (2631B only)
# prn -t	same, except also pass -t to pr


# Check usage:

	if [ $# -lt 1 ]
	then
		echo "usage: $0 [-d] files..."
		exit 1
	else
		echo $0 $*			# show list of arguments.
	fi


# Check for option:

	tflag=""

	if [ $1 = "-d"  -o  $1 = "-t" ]
	then
		if [ $1 = "-t" ]		# turn off header/trailer.
		then
			tflag=$1
		fi
		shift
		num=""				# unnumbered.
		prefix="\033&k0S\c"		# normal width.
	else
		num="-n"			# numbered.
		prefix="\033&k2S\c"		# compressed.
	fi


# Spool files:

	{	for file in $@
		do	echo spooling $file >/dev/tty
			echo $prefix
		pr $tflag $num -h "				$file	" $file
		done
	} | lpr
