nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: check if message is in a particular sequence?


From: Ralph Corderoy
Subject: Re: check if message is in a particular sequence?
Date: Fri, 30 Apr 2021 22:30:35 +0100

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]