setting up /etc/printcap on SunOS 4.1
Calvin Hayden x2254
cgh018 at tijc02.uucp
Sat Dec 15 03:03:54 AEST 1990
>From article <1990Nov28.212619.6018 at uunet!unhd>, by rg at uunet!unhd (Roger Gonzalez ):
> I'm new to the use of /etc/printcap; I'm used to using lp on old clunky
> SysV clones.
So was I... The SysV ones do have a few nice features...
> One thing that the old lp gave me was the ability to write my own
> shell script that would be run for any particular printer. Every time,
> not just on receipt of certain filter options, like specified in
> /etc/printcap.
Yep, the good ole days...
> I miss this ability, because we use a funny system here. We have 3
> printers and a prom burner connected to one serial port via a PrintMaster
> box. The PrintMaster selects a port on receipt of a string that looks
> like "$PRINTER3". I need to be able to send a string like this before
> every print job.
You're in luck...
I have several printers connected to a Netcommander. I have a cable
running from my SparcStation(4.1) to a port on the Netcomm. The net
comm watches the input port(s) for a string of the fashion
"\022PRINTERNAME". Based on the value of PRINTERNAME, it directs the
output to the port connected to PRINTERNAME. Sound familiar? The
trick was to set the if= field to say if=/usr/spool/filters/my_lp_script.
I also had to create a wrapper around the lpr command. I created an
lp script that took SysVish arguments, built a header file, concatenated
other files, and then invoked the true lpr command. The fisrt thing in
my header file was the name of the printer destination. One of the first
things that my_lp_script did was :
read line
set $line
printer=$1
case $printer in
deskjet) /usr/5bin/echo "\022DESKJET";;
lno3) /usr/5bin/echo "\022LNO3";;
esac
cat 2>&1
You get the idea.
> Also, I RTFMed briefly about the flag bits, but started to get a whopping
> headache. All I want to do is set the stupid thing for 9600 baud, 8
> data bits, no parity. Thats all. No jumping through hoops. Could
> someone who has gone through this before please help an impatient
> and frustrated wreck of a sysop? Pretty please?
9600 is easily set in /etc/printcap. If you do things like I mention,
my_lp_script can do a "stty cs8 ..." first to prime the line. I've been
lucky on flags. We use lno3's, deskjet, printronics. and I`ve not
had to muck with flags much.
> -Roger
I am posting, and trying to email as well. If you need more help,
let me know and I`ll email (or post if I have to) you a copy of
my lp script, /etc/printcap, and /usr/spool/filters/whatever.
Careful though, SunOS4.1 /bin/lp is linked to /bin/lpr... :)
Hope this helps.
Cal Hayden
TI, Johnson City, TN
Voice: (615) 461-2254
uucp: ...mcnc!rti!tijc02!cgh018
--
Calvin Hayden
Texas Instruments, Johnson City, Tn.
Voice (615)461-2254
UUCP: ...mcnc!rti!{olympus,tijc02}!{root,cgh018}
More information about the Comp.unix.questions
mailing list