Operating System - HP-UX
1755744 Members
2502 Online
108837 Solutions
New Discussion юеВ

multiple copies on line printer

 
ARUN_19
Advisor

multiple copies on line printer

Hi
I have configured a non-hp line printer (PRINTRONIX P500) on 10.2 o/s using SAM as a remote printer. It works fine except for the lp -n command which is used for mulitiple copies. When executed, lp -n will print a single copy only. If configured as a local printer lp -n will print multiple copies. The printer is configured as a network printer by attaching a pocket sized print server. Any clues to resolve the issue??
7 REPLIES 7
vinod_25
Valued Contributor

Re: multiple copies on line printer

hi arun

HP-UX does not support this in the rmodel file,but the following work-around will allow you to have this functionality.

Important: This work-around is not a supported by HP.

1) Ensure you have the latest rlpdaemon patch
installed ( [PHCO_16106/PACHRDME/English] ).

2) Ensure that the following files have their permissions set to 04555:

/usr/sbin/rlpstat
/usr/sbin/rlp
/usr/sbin/rlpdaemon

3) Add the remote printer in the normal fashion using SAM or lpadmin.

4) cd /etc/lp/interface and verify that
the new printer has been added.

5) Copy the name of the printer to a backup name,
e.g: cp remprint remprint.old

6) Edit the printer file and at the bottom of the file you will see:

shift; shift; shift; shift; shift
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2
$BSD3 $BS
D4 $BSDw $BSDformat $BSDh $1
ret=$?
case $ret in
0)
exit 0
;;
*)
reason="error $ret returned"
;;
esac
disable -r"$reason" $printer
exit 1

Change this to:

shift; shift; shift; shift; shift
#multi copy
CNT=$COPIES
for i in $COPIES
do
/usr/lib/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2
$BSD3 $BSD
4 $BSDw $BSDformat $BSDh $1
done
ret=$?
case $ret in
0)
exit 0
;;
*)
reason="error $ret returned"
;;
esac
disable -r"$reason" $printer
exit 1


regards


Vinod
Mahesh Kumar Malik
Honored Contributor

Re: multiple copies on line printer

Hi Arun

I suggest using Branded Print servers since they have more buffer size and thus avoid loss of data and control bytes.

Regards
Mahesh
ARUN_19
Advisor

Re: multiple copies on line printer

Hi,
I have closed early today..shall try the trick tommorrow and get back...many thanks for the info....
ARUN_19
Advisor

Re: multiple copies on line printer

Hi Vinod,
I tried the modified script.. but it is not working?? Even normal lp command also does not send an output..
I dont know where i have erred...Mean while extending the same logic and comparing interface files of local printer the the following lines were added which SOLVED THE PROBLEM!!!



cpt=$4
shift; shift; shift; shift; shift
files=$*

i=1
while [ $i -le $cpt ]
do
for file in $files
do
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $BSDformat $BSDh $file
done
i=`expr $i + 1`
done

ret=$?
case $ret in
0)
exit 0
;;
*)
reason="error $ret returned"
;;
esac
disable -r"$reason" $printer
exit 1


MANY THANKS FOR THE CLUE......

Re: multiple copies on line printer

Hi!
I organized and commented this part of the shell, so, take a look:

# These lines changed for allowing multicopies 15/02/2006

#shift; shift; shift; shift; shift
#
# /usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $BSDformat $BSDh $1
#ret=$?
#case $ret in
#0)
# exit 0
# ;;
#*)
# reason="error $ret returned"
# ;;
#esac
#disable -r"$reason" $printer
#exit 1
#
#



nCount=1 #Start counter
nCopies=$4 #Define number of copies

shift; shift; shift; shift; shift # take away useless parameters
cFiles=$* # Define files to be printed

while [ ${nCount} -le ${nCopies} ]; do # while have copies for being printed ...
for cFile in ${cFiles} ;do # print all files...
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $BSDformat $BSDh ${cFile}
done
i=`expr ${nCount} + 1` # increase Counter
done

nError=$?

case ${nError} in
0) exit 0;;
*) reason="error $ret returned"
disable -r"$reason" $printer
exit ${nError} ;;
esac


Regards

Chuck Billy

Re: multiple copies on line printer

Sorry Fellows!
But, even the script below had errors.
Now, this one, I'm sure , is correct.
Take a look:

# These lines changed for allowing multicopies 15/02/2006

#shift; shift; shift; shift; shift
#
# /usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $BSDformat $BSDh $1
#ret=$?
#case $ret in
#0)
# exit 0
# ;;
#*)
# reason="error $ret returned"
# ;;
#esac
#disable -r"$reason" $printer
#exit 1
#
#



nCount=1 #Start counter
nCopies=$4 #Define number of copies

shift; shift; shift; shift; shift # take away useless parameters
cFiles=$1 # Define files to be printed


while [ ${nCount} -le ${nCopies} ]; do # while have copies for being printed ...
for cFile in ${cFiles} ;do # print all files...
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $BSDformat $BSDh ${cFile}
done
nCount=`expr ${nCount} + 1` # increase Counter
done

nError=$?

case ${nError} in
0) exit 0;;
*) reason="error $ret returned"
disable -r"$reason" $printer
exit ${nError} ;;
esac
ARUN_19
Advisor

Re: multiple copies on line printer

issue resolved