|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- #!/bin/sh
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- GS_EXECUTABLE=gs
-
- PBMPLUSPATH=/usr/local/bin
- PSFILTERPATH=/usr/local/lib/ghostscript
- LOCALPATH=/usr/local/bin
- X11HOME=/usr/X11R6
-
- PATH=/bin:/usr/bin:/usr/ucb:/usr/etc
- PATH=${PATH}\:${LOCALPATH}\:${PBMPLUSPATH}\:${PSFILTERPATH}
- LD_LIBRARY_PATH=${X11HOME}/lib
-
- export PATH LD_LIBRARY_PATH acctfile host user
-
- user= host= acctfile=/dev/null
-
-
-
-
-
-
- exec 3>&1 1>&2
-
-
-
-
- while [ $# != 0 ]
- do case "$1" in
- -n) user=$2 ; shift ;;
- -h) host=$2 ; shift ;;
- -*) ;;
- *) acctfile=$1 ;;
- esac
- shift
- done
-
-
-
-
- filter=`basename $0`
- device=`dirname $0`
- type=`dirname ${device}`
- device=`basename ${device}`
- fdevname=$device
- type=`basename ${type}`
-
-
-
-
-
- colorspec="`echo ${device} | sed 's/.*\.[0-9][0-9]*\.\([0-9][0-9]*\)$/\1/'`"
- if test "$colorspec" = "${device}"
- then
- colorspec=""
- else
- device=`basename ${device} .$colorspec`
- colorspec="-dColors=$colorspec"
- fi
-
- bpp="`echo ${device} | sed 's/.*\.\([0-9][0-9]*\)$/\1/'`"
- if test "$bpp" = "${device}"
- then
- bpp=1
- else
- device=`basename ${device} .$bpp`
- fi
-
-
-
-
- lock=`dirname ${acctfile}`/lock
- cf=`sed -n '$p' ${lock}`
- job=`sed -n 's/^J//p' ${cf}`
-
- echo "gsbanner: ${host}:${user} Job: ${job} Date: `date`"
- echo "gsif: ${host}:${user} ${fdevname} start - `date`"
-
-
-
-
-
-
-
- case "${type}" in
- direct)
- gsoutput="cat 1>&3" ;;
-
- indirect)
- gsoutput="lpr -P${device}.raw" ;;
-
- esac
-
- (
-
-
-
-
-
-
-
-
- case "${filter}" in
- gsif) cat ;;
- gsnf) psdit ;;
- gstf) pscat ;;
- gsgf) psplot ;;
- gsvf) rasttopnm | pnmtops ;;
- gsdf) dvi2ps -sqlw ;;
- gscf|gsrf) echo "${filter}: filter not available" 1>&2 ; exit 0 ;;
- esac
-
-
-
-
- echo "\
- (acctfile) getenv
- { currentdevice /PageCount gsgetdeviceprop dup cvi 0 gt
- { exch (a) file /acctfile exch def
- /string 20 string def
- string cvs dup length dup
- 4 lt
- { 4 exch sub
- { acctfile ( ) writestring } repeat
- } { pop } ifelse
- acctfile exch writestring
- acctfile (.00 ) writestring
- acctfile (host) getenv
- { string cvs } { (NOHOST) } ifelse writestring
- acctfile (:) writestring
- acctfile (user) getenv
- { string cvs } { (NOUSER) } ifelse writestring
- acctfile (\n) writestring
- acctfile closefile
- } { pop } ifelse
- } if
- quit"
- ) | $GS_EXECUTABLE -q -dNOPAUSE -sDEVICE=${device} \
- -dBitsPerPixel=${bpp} $colorspec \
- -sOutputFile=\|"${gsoutput}" -
-
-
- rm -f ${gspipe}
-
-
-
- echo "gsif: end - `date`"
-
|