Redirecting printer output from a PC to lp

John Poplett john at cstreet.com
Thu Oct 4 17:19:11 AEST 1990


This evening I got intrigued with the possibility (and low-cost!)
of redirecting printer output from a PC running MS-DOS to a
SCO-based system (Xenix 386 2.3.2) and onto lp. I established a 
serial connection, used the "mode" command on DOS to redirect 
printer-bound output to COM1 and set about to write a shell-script 
to snag I/O from the serial line and reroute it to lp. That's 
where the fun begins.

I setup the DOS machine with two mode commands:

mode LPT1:=COM1:
mode COM1:12

This establishes the primary serial port as the primary port for 
printer output at a baud rate of 1200 at 7 bits and even parity.

The shell script below has (at least) two failings. 1) I haven't
succeeded in coaxing it to detect end of file and 2) after much
mucking around with cr/lf mapping, I never convinced the line
discipline to properly map cr/lf pairs to linefeeds (with
double-spacing as the regrettable result).

:

#
# parity = cs7 + parenb (even parity enabled)
#


(stty parity -icanon -isig -echo min 1 time 1 1200 ; cat) < /dev/tty2a |
lp -ob

exit 0

If anyone can make suggestions on improving this shell script (or my
approach in general), please let me know. I'll post if there's interest.

John
-- 
John Poplett @ C Street Software     | A woman who doesn't change
312 Wolff St. Oxnard, Ca. 93033 USA  | her mind, doesn't have one.
(805) 486-7807 / john at cstreet.com    |      ~ Mae West



More information about the Comp.unix.xenix.sco mailing list