rick@comspec.UUCP (Rick McCalla) (02/26/90)
I am currently running a Xenix 386 box that does not have a printer attached to it. When I need to print something I cat it into a script which will in turn save it as a file and then email it to another Xenix 386 box next to it which will print it out on the printer attached to it. I am trying to get the normal print spooler 'lp' to work in a similiar way and cat any input out to this script. Does anyone have an ideas of how to go about this? -- Comspec Communications Inc. | Rick McCalla ----- rick@comspec Toronto, Ontario Canada |---------------------------------- Voice : (416) 785 - 3553 | Path: uunet!mnetor!becker! Fax : (416) 785 - 3668 | comspec!rick
woods@robohack.UUCP (Greg A. Woods) (02/28/90)
I use the following script, along with 'COMMANDS=rmail:lp' (or
something close) in the destination machine's Permissions file.
Be sure to read the comments, they point out a few caveates and
configuration options.
-------------- cut here --------------
#
# lp interface for a remote printer
#
#
PATH=/bin:/usr/bin:/usr/lbin:/usr/local/bin ; export PATH
PRINTER=`basename $0`
TITLE=$3
COPIES=$4
OPTIONS=$5
#
# NOTE, some lp's (notably the one on 3B1's) have 6 options
#
shift; shift; shift; shift; shift
files="$*"
# mktable is in /usr/lbin on most SysV's
#
# /usr/spool/lp/remote_mach is a list of printers and sites, separated
# by tabs:
#
#AppleLaser gate
#
#
MACHINE=`mktable /usr/spool/lp/remote_mach | grep $PRINTER | cut -f2-`
# keep a log of remote print jobs
#
echo "`date +%D-%T`:$PRINTER:$MACHINE:$RAW:-t$TITLE:-o$OPTIONS:-n$COPIES:$files" >> /usr/spool/lp/remlog
for F in $files
do
FILES="$FILES !$F"
done
# NOTE: uux "sees" single quotes. You must not put them anywhere where
# white space is not allowed (i.e. -t'$TITLE'), as uux will introduce
# a space before the first single quote, and similarly for ending single
# quotes if there is not already whitespace.
uux -n -C "$MACHINE!lp -c -d$PRINTER '-t$TITLE' '-o$OPTIONS' -n$COPIES $FILES" >> /usr/spool/lp/remlog 2>&1
# don't confuse lpsched!
exit 0
--
Greg A. Woods
woods@{robohack,gate,eci386,tmsoft,ontmoh}.UUCP
+1 416 443-1734 [h] +1 416 595-5425 [w] VE3-TCP Toronto, Ontario; CANADA