[comp.unix.questions] setting up /etc/printcap on SunOS 4.1

unhd (Roger Gonzalez ) (11/29/90)

I'm new to the use of /etc/printcap; I'm used to using lp on old clunky
SysV clones.

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.

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.

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?  

Its really strange right now.  All the printers work except the HP laserjet,
which spews out a garbagy version of what I send, if anything.  I did a
stty -a < /dev/ttya and found that its being set to 7 bits, even parity.
Sure enough, the garbage chars on the HP look vaguely like what you'd get
if you sent it 8-bit characters...

I've got a headache.  Please have pity and spare me further RTFMing.


-Roger

-- 
"The question of whether a computer can think is no more interesting
 than the question of whether a submarine can swim" - Edsgar W. Dijkstra 
rg@unhd.unh.edu               |  UNH Marine Systems Engineering Laboratory
r_gonzalez@unhh.bitnet        |  Durham, NH  03824-3525

cgh018@tijc02.uucp (Calvin Hayden x2254) (12/15/90)

From article <1990Nov28.212619.6018@uunet!unhd>, by rg@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}