From owner-freebsd-stable@FreeBSD.ORG Sat Jan 10 09:47:20 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C587916A4D2 for ; Sat, 10 Jan 2004 09:47:20 -0800 (PST) Received: from turkey.mail.pas.earthlink.net (turkey.mail.pas.earthlink.net [207.217.120.126]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DD9E43D48 for ; Sat, 10 Jan 2004 09:47:18 -0800 (PST) (envelope-from pixfbsd@earthlink.net) Received: from user153.net413.tx.sprint-hsd.net ([65.40.98.153] helo=[192.168.10.11]) by turkey.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1AfNCd-0003ak-00; Sat, 10 Jan 2004 09:47:16 -0800 From: pixfBSD To: Malcolm Kay In-Reply-To: <200401101603.31874.malcolm.kay@internode.on.net> References: <1073707290.4872.9.camel@hawk.dlqj.net> <200401101603.31874.malcolm.kay@internode.on.net> Content-Type: text/plain Message-Id: <1073756820.4872.32.camel@hawk.dlqj.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 10 Jan 2004 11:47:00 -0600 Content-Transfer-Encoding: 7bit cc: freebsd-stable@freebsd.org Subject: Re: hp date stamp ink cartridges X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Jan 2004 17:47:20 -0000 Moved back to original suggested syntax (Thank you very much Malcolm.) printf "\033&k2G" && sed -e 's/@PJL SET DATE=[0-3][0-9]-[01][0-9]-20[0-9][0-9]/@PJL SET DATE=01-12-2000/g' && printf "\033&l0H" && exit 0 and it works!! Why did I think it didn't work... umm, well, umm I was disabling printing and looking at the df but until I was going through Malcolms questions of: > What happens when you try to print ? > Expired message? > Nothing? it occurs to me that duh, the filter doesn't filter until it's sending the print job to the printer. It's not filtering as it goes to the queue. Thanks again!! On Fri, 2004-01-09 at 23:33, Malcolm Kay wrote: > On Sat, 10 Jan 2004 14:31, pixfBSD wrote: > > #!/bin/sh > > # > > # hpif - Simple text input filter for lpd for HP-PCL based printers > > # Installed in /usr/local/libexec/hpif2 > > # > > # Simply copies stdin to stdout. Ignores all filter arguments. > > # Tells printer to treat LF as CR+LF. Ejects the page when done. > > > > printf "\033&k2G" && cat && printf "\033&l0H" | sed -e 's/@PJL SET > > DATE=[0-3][0-9]-[01][0-9]-20[0-9][0-9]/@PJL SET DATE=01-12-2001/g' && > > exit 0 > > exit 2 > > > > Thanks to the suggestion of the sed syntax I've tried a few renditions > > of this script. (Sorry I forget who was the kind person with this > > syntax) I've been through a reload and could have sworn I had a backup > > of my mail directory :-P doh! > > > > I've put the sed part after first ""printf "\033&k2G" && sed -e 's/@PJL > > SET DATE=[0-3][0-9]-[01][0-9]-20[0-9][0-9]/@PJL SET DATE=01-12-2001/g' > > ..."" I've even tried piping it after the first printf. It still > > doesn't change the date on the dfA009. > > This was my suggestion! > > (I thought you had disappeared into oblivion ;-) ). > > > > > If I sed -e 's/@PJL SET DATE=[0-3][0-9]-[01][0-9]-20[0-9][0-9]/@PJL SET > > DATE=01-12-2001/g' dfA009 > dfA009. It does > > change the line just fine. > > > > Then maybe sed is not in the path as seen by lpd. > Try a full path: i.e. /usr/bin/sed in place of sed. > > I should have thought of this possibility in the first place. > (I believe the 'cat' should be superfluous) > > For the record, my original suggestion was: > > printf "\033&k2G" && sed -e 's/@PJL SET DATE=[0-3][0-9]-[01][0-9]-20[0-9][0-9]/@PJL SET DATE=01-12-2000/g' && printf "\033&l0H" && exit 0 > > Malcolm Kay > >