On Wed, Sep 19, 2001 at 02:16:16PM +0100, Paul Jakma wrote:
> On Wed, 19 Sep 2001, Paul Jakma wrote:
>> > you need a pty. and you need to hack together a little c proggy to
> > allocate it and spit and suck the various bits to where you want em.
>> as someone else pointed out, it's a serial printer. so there won't be
> anything coming back.
>> sounds to me like the filter route "cat - | tee ..." suggested
> already is the best way to go.
Jeez Louise - I wonder if some of the people making suggestions have ever
actually used serial printers ? (Yes, I have, and it's never pleasant unless
it's the nth use of the same printer/OS/hardware setup, n > 2). Unless
you've got either a very fast printer or are using a very low baud rate, the
printer will be sending "stuff' back to the logging device. What it will
send back is handshaking information, which may be hardware i.e. using
various combinations of RTS/CTS/Lord alone knows what or software e.g.
XON/XOFF (though you can have other sequences used too, if you're unlucky
enough). So I'd say your chances of tee printer.log </dev/ttyS0 >ttyS1
working absolutely reliably are slim. However it may be close enough for
government work, so if it's a government contract . . . . If you're trying
to e.g. catch the call records coming out the back of a PBX it'll probably
work well enough, but if you absolutely can't risk losing a single character
coming out of the driving device, it's not a flier.
The bulletproof way to do this on a Linux box is to write a program which
emulates a printer i.e. accepts data on a serial port and logs said data and
sends it to the real printer via another port, handling handshaking on both
ports as necessary. I'd be surprised if you'd write such a program for less
than one of the devices Kenn mentioned will cost you. (Just curious Kenn -
with your heavy use of loggers, I did expect you to jump in here. Have you
never needed such a program, or do you just use those cute little boxes with
a fast enough Linux box [and it's not going to need to be all that fast] ?)
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!