*BSD News Article 78181


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!lynx.aba.net.au!munnari.OZ.AU!metro!metro!asstdc.scgt.oz.au!nsw.news.telstra.net!act.news.telstra.net!psgrain!iafrica.com!uct.ac.za!quagga.ru.ac.za!howland.erols.net!news1.erols.com!news
From: Ken Bigelow <kbigelow@www.play-hookey.com>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Printing problem with Okidata OLE600.
Date: Thu, 12 Sep 1996 18:47:51 +0000
Organization: Erol's Internet Services
Lines: 54
Message-ID: <32385AD7.1632@www.play-hookey.com>
References: <01bb9e93$2739c860$9bc4abc7@glen> <3234727C.6028@www.play-hookey.com> <01bb9f94$4e7e5920$7ac4abc7@glen> <3235D81C.47E6@www.play-hookey.com> <01bba11e$bf0cd280$81c4abc7@glen>
Reply-To: kbigelow@www.play-hookey.com
NNTP-Posting-Host: kenjb05.play-hookey.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (Win16; U)

Glen wrote:
> 
> This is what I can up with!
> 
> #include <stdio.h>
> 
> main ()
> 
> {
>         int c;
>                 while (( c = getchar()) != EOF)
>         {
>                 if ( c == '/n')
>                 putchar(13);
>                 putchar(c);
>         }
> return (0);
> }
> 
> My new problem!!!!!!!!!  This is my filter file.
> 
> /bin/cat | theaboveprogram > Now I don't know what to do.  How do I write
> this filter file.  I have tryed all different things.
> 
> Thank You.
> 
> I do know a little C.  Just don't know how to imply it well.
> 


Close. Define c as a char, not an int. Also, I'm not sure whether or not
this routine will actually see an EOF marker, and I don't think it needs
one. Remember that here we are dealing with characters being sent to a
printer. The printer won't recognize an EOF or know what to do with it;
it will just print what it gets. The filter program just gets into the
character stream and plays with it a little.

As for using it as a filter, refer to the Handbook. The section on
Printing is quite detailed, and includes setting up the filter file and
defining it properly in /etc/printcap. Once you've defined it, the
filter program will be automatically piped between the source and the
printer.

Above all, be willing to tweak it a bit and waste a few sheets of paper
in testing.

I hope this helps!

-- 
Ken

Are you interested in   |
byte-sized education    |   http://www.play-hookey.com
over the Internet?      |