From owner-freebsd-questions Fri Jan 5 8:34: 6 2001 From owner-freebsd-questions@FreeBSD.ORG Fri Jan 5 08:34:05 2001 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from groggy.anc.acsalaska.net (groggy.anc.acsalaska.net [198.70.228.224]) by hub.freebsd.org (Postfix) with ESMTP id 7212737B402 for ; Fri, 5 Jan 2001 08:34:03 -0800 (PST) Received: (from def@localhost) by groggy.anc.acsalaska.net (8.9.3/8.9.3) id QAA16180 for freebsd-questions@freebsd.org; Fri, 5 Jan 2001 16:33:58 GMT (envelope-from def1@iname.com) Date: Fri, 5 Jan 2001 16:33:58 GMT From: def1@iname.com Message-Id: <200101051633.QAA16180@groggy.anc.acsalaska.net> X-Authentication-Warning: groggy.anc.acsalaska.net: def set sender to def1@iname.com using -f Subject: lpt0 / lp driver X-Mailer: Umail v1.7 (FreeBSD) To: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG for more than a few years i have had the same problem on many printers on many machines bar none. the problem is that the first file of a print job gets an extra blank line at the top of the page, decreasing the number of lines on the first page of a set of print jobs by one. ie - if i say: $ cat file1 | lpf > lpt0 && cat file2 | lpf > lpt0 then only file1 will be prefixed with a blank line on it's first page, file2 will print as expected. this is the filter i use ... [please ditto any responses off list, thanks ...] #!/bin/sh # # lpf -- LP Filter. # prints PS (%!) * DOS (CRLF) * UNIX (LF) files. # printer should be set to DOS mode -> EOL=CR/LF. # 'read' destroys any ASCII 0 characters in 1st line. # 'echo' destroys leading whitespace space in 1st line. # PRN='-sDEVICE=okiibm -r240x144' # EPSON FX-100 # PRN='-sDEVICE=djet500 -r300' # HP DJ500 # PRN='-sDEVICE=cdj850 -r300' # HP DJ850 PRN='-sDEVICE=ljet2p -r333' # OKIDATA OL600e read -r line1 # snag 1st line into filter, don't treat \'s specially. if echo "$line1" | grep -q '^%!'; then gs -q $PRN -sOutputFile=- - && exit 0 elif echo "$line1" | grep -q '^M$'; then echo "$line1"; cat && echo -n && exit 0 else echo "$line1^M"; cat | sed s/$/^M/ && echo -n && exit 0 fi exit 2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message