:
# lp interface for network line printer
#
#	@(#)network	1.2 87/12/01 

MACHINE=machine

id=$1
user=$2
title=$3
copies=$4
oopts=$5
Otheropts=""
shift; shift; shift; shift; shift
for i in $oopts
do
	case $i in
	    -*) Otheropts="$Otheropts $i"
		;;
	esac
done
files=""
sys="@`cpu`"
for i in $*
    do
	x=`dirname $i`
	until [ '(' $x = '/' ')' -o '(' $x = '.' ')' ]
	    do
		x=`dirname $x`
	    done
	if [ $x = '/' ]; then
	    files="$files $sys$i"
	else
	    files="$files $i"
	fi
    done
# Use this if your $MACHINE has the System V print spooler:
cat $* | permit -r $MACHINE @$MACHINE/usr/bin/lp -t"$title" -n"$copies" $Otheropts 2>> /usr/spool/lp/log
# Otherwise use this:
#permit -r $MACHINE @$MACHINE/bin/lpr $Otheropts $files 2>> /usr/spool/lp/log
