home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
tusportal.tus.k12.pa.us
/
tusportal.tus.k12.pa.us.tar
/
tusportal.tus.k12.pa.us
/
Wyse
/
latest-image.raw
/
0.img
/
usr
/
lib
/
cups
/
filter
/
dvitops
< prev
next >
Wrap
Text File
|
2010-02-10
|
826b
|
42 lines
#!/bin/sh
if test "$#" -lt "5"; then
echo "ERROR: Number of arguments ($#) is wrong" 1>&2
exit 1
fi
if test "$#" -gt "6"; then
echo "ERROR: Number of arguments ($#) is wrong" 1>&2
exit 1
fi
# Log the command line
echo dvitops: $@ 1>&2
# Get the last parameter (which is the filename if present)
eval filename="\${$#}"
if [ -e $filename ]; then
FILE_TO_PRINT=$filename;
else
FILE_TO_PRINT="";
fi
if [ -z $FILE_TO_PRINT ]; then
FILE_TO_PRINT=`mktemp -q /tmp/dvitops.XXXXXX`
if [ $? -ne 0 ]; then
echo "ERROR: Can't create temp file, exiting..." 1>&2
exit 1
fi
trap "rm -f $FILE_TO_PRINT" EXIT SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
cat >$FILE_TO_PRINT
fi
if [ -z $FILE_TO_PRINT ]; then
/usr/bin/dvips -q -f
else
/usr/bin/dvips -q -f <$FILE_TO_PRINT
fi