From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <102653723422024.tru64-unix-managers.marc@archive.invalid> From: "Smith, Lawrie" Date: Thu, 24 Jan 2002 09:33:31 +0000 To: tru64-unix-managers Subject: SUMMARY: Printcap and input filters (if:) X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=102653723422024 MIME-Version: 1 Content-Type: multipart/mixed; boundary="------_=_NextPart_001_01C1A4BA.2F8CBF30" 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_01C1A4BA.2F8CBF30 Content-Type: text/plain Many thanks to Alan Davis, the answer arrived in my intray before my mail asking the question!! I knew this list was good but telepathic prescience as well?!? Question: Does anyone know how I can capture what gets passed to the 'if' file defined in printcap? eg. if:/usr/lbin/hplaserof:\ Can I replace the /usr/lbin/hplaserof string with something else to redirect what ever is passed to a text file? Answer: Here's how I've done it in the past : /etc/printcap entry : test|Test entry:\ :if=/local/bin/test_lp_filter.ksh:\ :sd=/usr/spool/testlp:\ :lf=/usr/adm/lperr:\ :lp=/dev/null: Script executed as input filter : #!/bin/ksh cat >/tmp/test.prn I have changed test.prn to test.$$ so I can save multiple test results Kind regards Lawrie Smith Capita Technical Services West Malling email: lawrie.smith@capita.co.uk Tel: 01732 877266 ------_=_NextPart_001_01C1A4BA.2F8CBF30 Content-Type: text/html Content-Transfer-Encoding: quoted-printable SUMMARY: Printcap and input filters (if:)

Many thanks to Alan Davis, the answer = arrived in my intray before my mail asking the question!!
I knew this list was good but = telepathic prescience as well?!?

Question:

Answer:
Here's how = I've done it in the past :
 
/etc/printcap = entry :
 
test|Test = entry:\
:if=3D/local/bin/test_lp_filter.ksh:\
:sd=3D/usr/spool/testlp:\
:lf=3D/usr/adm/lperr:\
:lp=3D/dev/null:
 
Script = executed as input filter :
 
#!/bin/ksh
cat = >/tmp/test.prn

I have changed = test.prn to test.$$ so I can save multiple test results

Kind regards

Lawrie Smith
Capita Technical Services
West Malling

email:  = lawrie.smith@capita.co.uk
Tel:    01732 = 877266

------_=_NextPart_001_01C1A4BA.2F8CBF30--