nmh-workers
[Top] [All Lists]

Re: check if message is in a particular sequence?

2021-04-30 16:41:34
Hi Paul,

Ken wrote:
    scan -format '%(msg)' sequence-name

Thanks.  Seems...  overkill...  to have to fire up a parsing language,

Haven't heard fgrep(1) called that before.  :-)

    $ scan -format '%(msg)' last:10 | fgrep -qx 42; echo $?
    1
    $ scan -format '%(msg)' last:10 | fgrep -qx 96910; echo $?
    0

Ken points out each message is opened by scan(1) even though the read
headers aren't used.  I thought

    pick -list last:10

may avoid that, but it also opens each file.  I suppose that means the
code which assembles the bytecode to do the formatting should set a flag
whenever it needs something from the email and if that's still clear
when the bytecode is run then the file need not be read.  Or, open the
file and read the headers lazily on first access.

-- 
Cheers, Ralph.

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