Listing 1: Interface file for the remote printer specified as /dev/null
# Put in a form feed at the end of the file to be printed.
# (The sixth parameter is the name of the print file. The name
# includes the directory that the print file exists in.)
echo "\014\c" >>$6
# Strip off the directory name and store the filename in a
# second variable. This second variable will be used to
# name the file on the receiving remote machine.
file=`echo $6 | tr -d /usr/spool/lp/temp`
# Copy the file to be printed over to the c:\spool directory
# on sale1's system using rcp.
# (The fourth parameter is the requested number of copies)
copies=$4
i=1
while [ $i -le $copies ]
do
rcp $6 sales1:/spool/$i$file
i=`expr $i + 1`
done
|