printing spool modifications

Allan Bjorklund allan at
Wed Jan 13 19:38:33 GMT 1999

On 13-Jan-99 Greg Dickie wrote:
> A "trick" I used at my last job pulled the filename from the
> PostScript code.
> This works very well assuming you are using PostScript.
> Greg

  That is what we do here.  Don't know what you would do if you were
using something else.

But this is the print script I use with LPRng:

--------------CUT HERE-----------------------------------------------
# allan at, June 28th, 1998.
# For use with LPRng.

title=`/usr/bin/head -200 $1 | /bin/grep "^%%Title:" |\
        /bin/sed "s/^%%Title:[ ]*\(..*\)[ ]*$/\1/" |\
        /bin/sed "s/^M//"`
if [ x"$title" != x ]; then
        /usr/local/lprng/bin/lpr -P$2 -J "$title" $1
        /usr/local/lprng/bin/lpr -P$2 $1
/bin/rm $1
--------------CUT HERE-----------------------------------------------

  For LPRng the -J parameter will tell it to report that as the job name
in lpq queries, and SAMBA will pick it up from there.

  For straight BSD print utilities I had to rename the spool file. 
None of the options that looked like they would substitute names for
the lpq output actually did that.  (At least under SunOS.)  Just be
careful of document names that use "/" in the title for obvious reasons.

  If someone does know the appropriate magic for passing an alternate
name for lpq to display for the BSD print utilities, I would like to


  Allan Bjorklund                  |                  allan at
  Systems Research Programmer      |           University of Michigan
  Information Technology Division  |               535 W. William St.
  1-(734)-763-9391                 |              Ann Arbor, MI 48103

More information about the samba-technical mailing list