Remote spooling; How do *you* submit files to a remote spooler?

Steve Bridges steve at pmday_2.Dayton.NCR.COM
Fri Feb 2 08:09:20 AEST 1990


In article <LARRY.90Jan31115055 at focsys.uucp> larry at focsys.uucp (Larry Williamson) writes:
>
> text deleted about remote spooling......

We had a similiar problem here.  We are using Expanded Towernet (a 
version of Xerox's XNS) to go between Towers.  One unfortunate problem
is that the version of Towernet for our 32/800 supports remote
printing to either an lpr printer or lp printer on any machine on
the network through either nprint or lprint.  However, the version of
Towernet for our 32/650 only supports remote spooling to an lpr
printer.  We have a laser on our 32/800 connected via lp, but our
users on the 32/650 were unable to remote print to it.  To solve
it, I wrote a shell script that emulates the lprint command.  It
is attached below.  There is some HP Laserjet specific escape
sequences in the script, so you might want to edit those out.  I'm
sure it could be adapted to use TCP/IP commands.  Another note
is that the send and rx commands use an account name of test.  This
is because of an quirk in Towernet where remote execute and
send commands require the use of a valid account name.

Well, here is the script....................
-----------------------------cut here----------------------------------
# lprint command for TOWER XP, 32/4X0, 32/6X0
# format of command is lprint sysname printer name files(s)
# all entries are required
#  if used as a pipe, format is some_command | lprint machine printername
#
#
#  for example, the command line version is lprint 800 -dp2 /etc/inittab
#          
#  This will print the file /etc/inittab on the machine known on the 
#  ethernet network as 800, on the printer called p2
#
#
#   The equivalent pipe version is cat /etc/inittab | lprint 800 -dp2
#
#   This will take the standard output from the cat command, build a
#   temporary file on disk, then send it to the remote machine, 
#   and remote execute the lp command, and then remove the work files
#
#
#    Modifications:
#
#    04/03/89:  Modifed command line mode to accept fully qualified path
#               names of files to remote print
#               Steve Bridges
#               USDPG Product Marketing and Support OLS

###  set up temporary variables since if on pipe mode, 2 shifts
###  will cause them to be lost
###  the 2 variables are for the remote machine and printer
#
machine=$1
printer=$2
#  stick in proper banner page  
#######################   LEAD BANNER   ###################################
echo "\n\n\n" > /tmp/temp$$
echo "6436-0201----------------------------------------------" >> /tmp/temp$$
echo "\n\n\n\n\n\n\n" >> /tmp/temp$$
echo "\n" >> /tmp/temp$$
#
#  get login name 
#
username=`who am i | cut -c1-8`
user=`grep $username /etc/passwd | cut -d: -f5`
banner $username >> /tmp/temp$$
echo "\n\n\n" >> /tmp/temp$$
echo >> /tmp/temp$$
echo "Remote print from Product Marketing Tower 32/650" >> /tmp/temp$$
echo " \n\n" >> /tmp/temp$$
if [ -n "$user" ]
then
	echo "User: $user\n" >> /tmp/temp$$
else
	echo "\n" >> /tmp/temp$$
fi
date >> /tmp/temp$$
echo "\n" >> /tmp/temp$$
echo "\014\c" >> /tmp/temp$$
#
###  If number of command line arguments is 3, assume command line mode
#
if [ "$#" -eq 3 ]
then
   cd `dirname $3`
   /bin/cat `basename $3` >> /tmp/temp$$
   send $machine -d /tmp -o test /tmp/temp$$ >/dev/null 2>&1
   rx $machine -d /bin -o test chmod 444 /tmp/temp$$ >/dev/null 2>&1
   rx $machine -d /usr/bin -o test lp $printer -c /tmp/temp$$
   rx $machine -d /bin -o test rm /tmp/temp$$ > /dev/null 2>&1
   rm /tmp/temp$$ > /dev/null 2>&1
   exit 0
fi
#
###   If we didn't exit above, assume pipe mode.  do 2 shifts
###   to retreive file name to print
#
shift;shift
/bin/cat $* >> /tmp/temp$$
send $machine -d /tmp -o test /tmp/temp$$ > /dev/null 2>&1
rx $machine -d /usr/bin -o test lp $printer -c -s /tmp/temp$$ 
rx $machine -d /bin -o test rm /tmp/temp$$ > /dev/null 2>&1
rm /tmp/temp$$ > /dev/null 2>&1
exit 0
-------------------------cut here-----------------------------------------
-- 
Steve Bridges                    | NCR - USDPG Product Marketing and Support OLS
Steve.Bridges at Dayton.NCR.COM     | Phone:(513)-445-4182 622-4182 (Voice Plus)
..!ncrlnk!usglnk!pmday_2!steve   | AOPA #916233
..!uunet!ncrlnk!usglnk!pmday_2!steve| PP-ASEL, AMEL



More information about the Comp.unix.questions mailing list