procmail
[Top] [All Lists]

Re: how to put "" in the match string

1998-12-01 06:19:46
On Tue, 1 Dec 1998 21:31:30 +0900 (JST),
nelsonhe(_at_)ews07(_dot_)nara(_dot_)kindai(_dot_)ac(_dot_)jp (Henry Nelson) 
wrote:
I'm trying to make a filter like the following:
:0 Bfbw
* $B.*\(J
|/usr/bin/nkf -e
I'm not sure how the real escapes come across in mail, but what
I need is literally '^[$B.*^[\(J' where '^[' is the code for
the [Esc] key.  I've tried quoting and escaping with \, but
haven't found a way.  TIA for any pointers.

You just have to insert the esc character literally. If your editor
doesn't allow that, you might want to try Emacs ;^) or this:

    # Your brand of echo(1) might use a different syntax
    # The task is to get a literal esc into ESC
    ESC=`echo -en '\033'`

    :0Bfbw
    * $ ($ESC)($)B.*($ESC)\(J
    | /usr/bin/nkf -e

The parentheses are just there to disambiguate. This is untested.

/* era */

-- 
.obBotBait: It shouldn't even matter whether    <http://www.iki.fi/~era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>

<Prev in Thread] Current Thread [Next in Thread>