Path: utzoo!attcan!uunet!snorkelwacker!mit-eddie!uw-beaver!ubc-cs!buchanan From: buchanan@cs.ubc.ca (John Buchanan) Newsgroups: comp.sys.sgi Subject: Re: Remote printing Message-ID: <7508@ubc-cs.UUCP> Date: 13 Apr 90 21:02:27 GMT References: <8448@tank.uchicago.edu> <11968@nlm-mcs.arpa> Sender: news@cs.ubc.ca Distribution: na Organization: Imager,UBC, DCS, Vancouver, B.C., Canada Lines: 116 In article <11968@nlm-mcs.arpa> states@tech.NLM.NIH.GOV (David States) writes: >In article <8448@tank.uchicago.edu> kur7@tank.uchicago.edu (Shin Kurokawa) writes: >> >>Any suggestions on how I can make a 4D/220 to access the printer >>that is physically connected to a BSD unix system on the >>network? > We have a printer hooked up to a PI, but would also like to provide access to the other printers which are attached to BSD machines. The following csh script has done the job for us. It is slow but works. #!/bin/csh -f # # lpr fake for Sys V # # Fake a minimal lpr # # John Buchanan 26 Feb 1990 # # the users must have a .rhosts which allows them access to both # hosts. set FILES = () set WOODY_HOST = abbott set OTHER_HOST = grads #default printer. set PRINTER = woody #available printers set PRINTERS = (woody \ garibaldi lw gari lw334 \ tusk lw244 \ clinker clink lwd lwdraft \ fissile lw332 \ wedge lw312 \ ) # #Parse the arguments only -P is allowed right now. # while (${#argv} >= 1) set flag = `echo $argv[1] | awk ' /\-..*/ {print substr($1,2,1) }'` if ($flag != "") then switch ($flag) case "P": set PRINTER = `echo $argv[1] | sed 's/-P//'` breaksw default: echo Unknown flag $argv[1] exit 1 endsw else set FILES = ($argv[1] ${FILES}) endif shift end # # if no files we assume stdin # if ( ${#FILES} == 0) then set FILES = ( /tmp/${USER}.lpr.tmp ) cat > /tmp/${USER}.lpr.tmp #copy stdin to /tmp endif #check to see if it is a valid printer set NOT_VALID = 1 foreach i ($PRINTERS) if ($i == $PRINTER) set NOT_VALID = 0 end if ($NOT_VALID == 1) then echo Sorry: the printer $PRINTER is unknown echo known printers are $PRINTERS exit 1 endif # # set up the printer spec # if ( ${PRINTER} == woody ) then set PRINT_HOST = ${WOODY_HOST} set LP = "lp -c -o-h -dwoody" else set PRINT_HOST = ${OTHER_HOST} set LP = (lpr -P${PRINTER} ) endif # # for each file copy to /tmp on the PRINT_HOST machine and then # print them out. # foreach i (${FILES}) rcp $i ${PRINT_HOST}:/tmp/lpr.${USER}.from.imager rsh ${PRINT_HOST} $LP /tmp/lpr.${USER}.from.imager rsh ${PRINT_HOST} /bin/rm /tmp/lpr.${USER}.from.imager end #remove tmp file if input was stdin. if (-e /tmp/${USER}.lpr.tmp ) /bin/rm /tmp/${USER}.lpr.tmp #end of lpr