From owner-freebsd-questions Wed May 28 00:08:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id AAA28851 for questions-outgoing; Wed, 28 May 1997 00:08:30 -0700 (PDT) Received: from iceberg.anchorage.net. (root@iceberg.anchorage.net [207.14.72.150]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id AAA28843 for ; Wed, 28 May 1997 00:08:24 -0700 (PDT) Received: from aak.anchorage.net (ai-130 [207.14.72.130]) by iceberg.anchorage.net. (8.6.11/8.7.3) with SMTP id WAA14485 for ; Tue, 27 May 1997 22:05:02 -0800 Date: Tue, 27 May 1997 22:37:40 -0800 (AKDT) From: Steve Howe X-Sender: abc@aak.anchorage.net To: freebsd-questions Subject: Re: print filter In-Reply-To: <199705271019.MAA00626@CoDe.hu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 27 May 1997, Zahemszky Gabor wrote: > > this is an "auto" bsd/dos lp filter i whipped up ... > > can anyone tell me why it prints a blank line at the > > beginning of each document (not page, document ...)? it actually prints the first line twice. > if echo "$line1" | grep -q '^M' ; then ... this doesn't change the behavior. > > ------------------------------------------------------------------------- > > #!/bin/sh > > # > > # simple lp text filter (BSD/DOS) > > > > read line1 > > > > if echo $line1 | grep ^M; then > > echo $line1 && cat && echo ^L && exit 0 > > else { echo $line1 && cat; } | sed s/$/^M/ && echo ^L && exit 0 > > fi > > exit 2 ------------------------------------------------------------------------- Sleep: a sign a caffeine deprivation ... http://www.anchorage.net/~un_x -------------------------------------------------------------------------