lp wrapper for filtering out priority 0 (zero) print jobs on Solaris "lp -q 0 /file"
bjester at maximsys.com
Tue Aug 23 13:51:17 PDT 2005
We have a legacy application that defaults to a print job priority of 0 (zero). The app is hard coded with: "lp -q 0 /file" CUPS allows print priorities of 1 - 100.
Platform: Sun Blade 150, Solaris 8 2/04, HP LJ4000 PS printer
Using CUPS, and CUPS lp binary, we were unable to print from our legacy application, and we (thankfully) received an error message, "lp: Priority must be between 1 and 100". Also, the (legacy) man page for Solaris lp was misleading because we were not reading the correct (CUPS) lp man page.
Wrote a small lp wrapper to "sed" out the priority 0 (zero) "q 0" argument and replace it with priority 1 (one) "q 1".
1. From a root xterm:
mv /usr/bin/lp /usr/bin/lp.ORIG
2. vi /usr/bin/lp
#This is the lp wrapper
echo $ARG > /tmp/ARG.$$
cat /tmp/ARG.$$ | sed -e 's/q 0/q 1/' > /tmp/NEWARG.$$
rm /tmp/ARG.* /tmp/NEWARG.*
chmod 555 /usr/bin/lp
chown root:sys lp
Maxim Systems Inc.
SPAWAR SC SD
More information about the cups