home *** CD-ROM | disk | FTP | other *** search
- :
- # @(#) qume1155.src 1.2 88/05/13
- #
- # Copyright (C) The Santa Cruz Operation, 1985, 1986.
- # This Module contains Proprietary Information of
- # The Santa Cruz Operation, Microsoft Corporation
- # and AT&T, and should be treated as Confidential.
- #
- #! Qume Sprint 1155 line printer
- # Options: lp -ob no banner
- #
- printer=`basename $0`
- request=$1
- name=$2
- title=$3
- copies=$4
- options=$5
- shift; shift; shift; shift; shift
-
- # for the qume we need to translate nl into nl cr
- # and we need to set the tabs each time a file is printed.
- # this could be done only once if you knew that the tabs
- # had been set properly. for some reason the qume doesn't like
- # any tab stops beyond 97.
- #
- # the printer was set to 9600 baud, no auto line feed (didn't seem
- # to work anyway), handshaking - xon xoff, no parity checking
- #
- stty 9600 opost onlcr ixon ixoff 0<&1
- echo "\033(09,17,25,33,41,49,57,65,73,81,89,97.\c"
-
- # border around the banner
- x="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
-
- banner=yes
- for i in $options; do
- case $i in
- b) banner=no ;;
- esac
- done
-
- [ "$banner" = yes ] && {
- # get the local system id
- if test -r /etc/systemid; then
- sysid=`sed 1q /etc/systemid`
- else
- sysid=`uname -n`
- fi
-
- # user = fifth field of /etc/passwd
- user=`sed -n "s/^$name:.*:.*:.*:\(.*\):.*:.*$/\1/p" /etc/passwd`
-
- # nhead gets the value of BANNERS or 1 by default
- nhead=`sed -n 's/^BANNERS=//p' /etc/default/lpd`
- [ "$nhead" -ge 0 -a "$nhead" -le 5 ] || nhead=1
-
- # print the banner $nhead times
- while [ "$nhead" -gt 0 ]
- do
- echo "$x\n"
- banner "$name"
- echo "$x\n"
- [ "$user" ] && echo "User: $user\n"
- echo "Request id: $request\n"
- echo "Printer: $printer\n"
- date
- echo "\nMachine: $sysid\n"
- [ "$title" ] && banner $title
- echo "\f\c"
- nhead=`expr $nhead - 1`
- done
- }
-
- # send the file(s) to the standard out $copies times
- while [ "$copies" -gt 0 ]
- do
- for file
- do
- cat "$file" 2>&1
- echo "\f\c"
- done
- copies=`expr $copies - 1`
- done
- exit 0
-