This post is continue from Add header to printout in HPUX using JetDirect, if you’re not using JetDirect but other print server such as DLINK, you might use method below to set your printout header:
- Add your queues using System Administrator Manager (SAM):
sam - Go to our destination:
cd /usr/bin. - Create a file called
enbanner. This is used to set which queue to print out header and which don’t, simply 1 stand for yes and 0 stand for no, and it is space sensitive (10 character space for the queue name). Here is the sample:
prt1 1
prt2 0 - You can found an execution file called lp, rename it to lporig:
mv lp lporig. - create a text file called lp and put in the following code:
#!/sbin/sh
TEMP=/tmp/printmp
printer=`echo $1 | /usr/bin/cut -b 3-100`
enbanner=`cat /usr/bin/enbanner | grep $printer | cut -c11`
if [ `expr $enbanner` != 0 ]
then
/usr/bin/lp2 $1 $2 $TEMP
/usr/bin/lporig $1 $TEMP $2
rm $TEMP
else
/usr/bin/lporig $1 $2
fi - create a text file called lp2 and put in the following code:
#!/bin/sh
fname=$2
TEMP=$3
printer=`echo $1 | /usr/bin/cut -b 3-100`
do_banner()
{
# Print the standard header
banner TESTING
account=`whoami`
banner $account
banner `basename $fname`
echo "\n"
reqque=`cat /var/spool/lp/seqfile`
reqqueadd=`expr $reqque + 1`
reqid=$printer-$reqqueadd
echo "Request id: $reqid Printer: `basename $printer`\n"
date
echo "\n"
echo "\f\r\c"
}
echo "" > $TEMP
do_banner >> $TEMP
- Then make lp and lp2 executable:
chmod 777 lp
chmod 777 lp2 - Now you can try to print out the header, depend on the setting at enbanner.




