Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!inquo!news.erinet.com!bug.rahul.net!rahul.net!a2i!ns2.mainstreet.net!news.PBI.net!news.mathworks.com!hunter.premier.net!news1.erols.com!news From: Ken Bigelow <kbigelow@www.play-hookey.com> Newsgroups: comp.unix.bsd.freebsd.misc Subject: Re: Printer filter file error Date: Mon, 15 Jul 1996 21:40:34 -0700 Organization: A poorly-installed InterNetNews site Lines: 39 Message-ID: <31EB1D42.493B@www.play-hookey.com> References: <4sd8g1$ruk@slowmo.techfak.uni-kiel.de> 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 2.02 (Win16; I) Maciej Wiatr wrote: > > Salute, > > I use freeBSD with a HP DJ500C and a proper (as I think) filter file, which > has woreked. Yesterday I got to know it does not work any more. > As I could understand, there is an error by the execution of the filter file. > I have to tell my printer to use CR+LF, when it receives LF by > printf "\033&k2G", but it is not accepted. Printf (as well as cat) > do not send the first character of the given string to the printer, > so it cannot interprete the above string as a command. > > In my case the sh shell is used. Despite the error it isw possible to print > text files by sending a blank space before the command line, but ps files > don't work. > > Does anybody know the reason ? What happens with the first character ? > > Please HELP ! > I can't say what happens to that first character; there are several possibilities. However, here's a suggestion for an alternative filter: Read the source (STDIN for the filter) one character at a time. If the character is LF, send CR to the printer (STDOUT). In any case, then send the character itself to STDOUT. This filter is real simple in C or any language that can read the input stream by characters, and won't skip any. I hope this helps! -- Ken Are you interested in | byte-sized education | http://www.play-hookey.com over the Internet? |