* SUMMARY: Printcap and input filters (if:)
@ 2002-01-24 9:33 Smith, Lawrie
0 siblings, 0 replies; only message in thread
From: Smith, Lawrie @ 2002-01-24 9:33 UTC (permalink / raw)
To: tru64-unix-managers
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="------_=_NextPart_001_01C1A4BA.2F8CBF30", Size: 4069 bytes --]
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>SUMMARY: Printcap and input filters (if:)</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE=3D2 FACE=3D"Arial">Many thanks to Alan Davis, the answer =
arrived in my intray before my mail asking the question!!</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">I knew this list was good but</FONT> =
<FONT SIZE=3D2 FACE=3D"Arial">telepathic prescience as well?!?</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">Question:</FONT>
<UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">Does anyone know how I can capture =
what gets passed to the 'if' file defined in printcap?</FONT><FONT =
FACE=3D"Arial"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">eg. =
if:/usr/lbin/hplaserof:\</FONT><FONT FACE=3D"Arial"> </FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Can I replace the /usr/lbin/hplaserof =
string with something else to redirect what ever is passed</FONT><FONT =
FACE=3D"Arial"></FONT> <FONT SIZE=3D2 FACE=3D"Arial">to a text =
file?</FONT><FONT FACE=3D"Arial"> </FONT>
</P>
</UL>
<P><FONT SIZE=3D2 FACE=3D"Arial">Answer:</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier New">Here's how =
I've done it in the past :</FONT>
<BR><FONT FACE=3D"Arial"> </FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier New">/etc/printcap =
entry :</FONT>
<BR><FONT FACE=3D"Arial"> </FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier New">test|Test =
entry:\</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">:if=3D/local/bin/test_lp_filter.ksh:\</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">:sd=3D/usr/spool/testlp:\</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">:lf=3D/usr/adm/lperr:\</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">:lp=3D/dev/null:</FONT>
<BR><FONT FACE=3D"Arial"> </FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier New">Script =
executed as input filter :</FONT>
<BR><FONT FACE=3D"Arial"> </FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier =
New">#!/bin/ksh</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Courier New">cat =
>/tmp/test.prn</FONT>
</P>
<P><FONT COLOR=3D"#000000" SIZE=3D2 FACE=3D"Arial">I have changed =
test.prn to test.$$ so I can save multiple test results</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Tahoma">Kind regards</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Tahoma">Lawrie Smith</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Tahoma">Capita Technical Services</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Tahoma">West Malling</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Tahoma">email: =
lawrie.smith@capita.co.uk</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Tahoma">Tel: 01732 =
877266</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C1A4BA.2F8CBF30--
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-24 9:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-24 9:33 SUMMARY: Printcap and input filters (if:) Smith, Lawrie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox