From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <102653649622161.tru64-unix-managers.marc@archive.invalid> From: Carl Carraway Date: Fri, 29 Jun 2001 17:54:13 +0000 To: tru64-unix-managers Subject: How to send printer output to a file instead of a printer X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=102653649622161 MIME-Version: 1 Content-Type: multipart/mixed; boundary="------_=_NextPart_001_01C100C4.81E73D90" This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C100C4.81E73D90 Content-Type: text/plain; charset="iso-8859-1" I need to route output from a printer queue to file instead of to a printer. This needs to function like a "dummy" print queue where the user can use the lpr command as if they were actually going to print the file, but the file needs to land in a hold directory where another application will grab the file and perform special processing that lpd/printcap cannot perform to produce the output and ultimately send it to a network printer. In /etc/printcap I have defined the following queue, called "testq". testq:\ :lp=/dev/null:\ :of=/usr/lbin/testq.of:\ :sd=/usr/users/spool/testq :lf=/usr/adm/testqerr: The output filter (/usr/lbin/testq.of) contains: #! /bin/csh -f # # Output filter for testq # # Test first to see if the print job can be copied to test.fil # /bin/cat > /usr/users/hold/testq/test.fil When I enter "lpr -P testq filename" the system queues the job into the testq queue, where it just sits. The control and data files sit in the spool directory /usr/users/spool/testq and no file appears in the desired final hold directory of /usr/users/hold/testq. The lf file is also blank after executing the lpr command. Also, in my output filter I attempted to copy the file to a file called /usr/users/hold/testq/test.fil. Is there a way the filename used in the lpr command can be passed and used to keep the file the same name when it is routed to the hold directory? If not I could use a timestamp in the output filter to assign a unique file name. Thanks in advance! Carl Carraway carrawayc@midlandstech.com Computer Systems Manager 803-738-7624 Midlands Technical College Columbia, SC ------_=_NextPart_001_01C100C4.81E73D90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Tape drive.
I = need to route=20 output from a printer queue to file instead of to a = printer.
 
This = needs to=20 function like a "dummy" print queue where the user = can
use = the lpr command=20 as if they were actually going to print the file, = but
the = file needs=20 to land in a hold directory where another = application
will = grab the file=20 and perform special processing that lpd/printcap = cannot
perform to produce=20 the output=20 and ultimately send it to a network printer.
 
In = /etc/printcap I=20 have defined the following queue, called "testq".
 
testq:\      &n= bsp;           &n= bsp;           &n= bsp;           &n= bsp;           &n= bsp;           &n= bsp;     =20
 =20 :lp=3D/dev/null:\         &= nbsp;           &= nbsp;           &= nbsp;           &= nbsp;           &= nbsp;    =20
 =20 :of=3D/usr/lbin/testq.of:\       &nbs= p;           &nbs= p;           &nbs= p;           &nbs= p;         =20
 =20 :sd=3D/usr/users/spool/testq       &n= bsp;           &n= bsp;           &n= bsp;  
 =20 :lf=3D/usr/adm/testqerr:   
 
The = output filter=20 (/usr/lbin/testq.of) contains:
 
#! = /bin/csh=20 -f           &nbs= p;           &nbs= p;           &nbs= p;           &nbs= p;           &nbs= p;     =20
#           &= nbsp;           &= nbsp;           &= nbsp;           &= nbsp;           &= nbsp;           &= nbsp;      =20
# Output filter for testq
#
# Test first to=20 see if the print job can be copied to test.fil
#       &n= bsp;           &n= bsp;           &n= bsp;           &n= bsp;     =20
/bin/cat > /usr/users/hold/testq/test.fil
 
 
When = I enter "lpr -P=20 testq  filename" the system queues the job = into
the = testq queue,=20 where it just sits.  The control and data files sit = in
the = spool directory=20 /usr/users/spool/testq and no file appears in = the
desired final hold=20 directory of /usr/users/hold/testq.    The  = lf  file=20 is
also = blank after=20 executing the lpr command.
 
Also, = in my output=20 filter I attempted to copy the file to a file called =
/usr/users/hold/testq/test.fil.   = Is there a=20 way the filename used in the
lpr = command can be=20 passed and used to keep the file the same name
when = it is routed to=20 the hold directory?   If not I could use a=20 timestamp
in = the output filter=20 to assign a unique file name.
 
Thanks in=20 advance!

Carl=20 Carraway          &nbs= p;           &nbs= p;   =20 carrawayc@midlandstech.com
Computer Systems=20 Manager      803-738-7624
Midlands Technical College
Columbia,=20 SC 

------_=_NextPart_001_01C100C4.81E73D90--