DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 14th June 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Thanked 8 Times in 8 Posts
Default Printer setup question

Hello,

I setup my lpd and printcap for my Brother laser printer (PostScript enabled) on my NetBSD system. The problem I am having is that the filter I wrote for it creates an error when handling shell script files. I think the error comes when the filter tries to process the files commands instead of printing them, but I am unsure of how to fix it.

Here is my /etc/printcap:

Code:
lp|local printer|Brother HL-5240
    :lp=/dev/ulpt0:sd=/var/spool/lpd/lp:lf=/var/log/lpd-errors:\
    :sh:mx#0:if=/usr/pkg/bin/t2ps-filter:

I took the filter straight out of "FreeBSD: The Complete Reference". Here is the t2ps-filter:

Code:
#!/bin/sh
# Check to see if input is PostScript. If not, pass through enscript.

read firstline
firstline=`expr "$firstline" : '\(..\)'`

if [ "$firstchars" = "%!" ]
then
    # PostScript file; pass through $firstline and rest of file
    echo "$firstline" && cat && printf "\004"
    exit 0
else
    # Not PostScript file; use enscript to process
    (echo "$firstline"; cat) | /usr/pkg/bin/enscript -p- \
        && printf "\004"
    exit 0
fi
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printer dont take rights mururoa FreeBSD General 3 5th October 2009 12:54 PM
FBSD 7.1 and Canon LBP-660 Printer Calderon FreeBSD General 8 4th May 2009 07:04 AM
Question regarding wireless setup stealintv FreeBSD General 5 19th September 2008 07:36 PM
IP Printer Setup kjemison FreeBSD General 4 2nd June 2008 02:35 PM
Cups + USB-Printer nihonto OpenBSD Packages and Ports 3 21st May 2008 07:49 PM


All times are GMT. The time now is 03:11 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick