Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2004 11:47:00 -0600
From:      pixfBSD <pixfbsd@earthlink.net>
To:        Malcolm Kay <malcolm.kay@internode.on.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: hp date stamp ink cartridges
Message-ID:  <1073756820.4872.32.camel@hawk.dlqj.net>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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<print.file> 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<example.file>.
> 
> 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<example.file> > dfA009<newtest.file>.  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
> 
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1073756820.4872.32.camel>