nmh-workers
[Top] [All Lists]

Re: format and output all received: lines in an e-mail message

2019-11-23 15:36:10
    Date:        Sat, 23 Nov 2019 20:26:27 +0530
    From:        Greg Minshall <minshall@acm.org>
    Message-ID:  <374462.1574520987@apollo2.minshall.org>

  | combined with (new-fangled) bash "process substitution",

If you're planning on using this much, I'd suggest avoiding making bash
do all that work (and making things work with shells that don't have this)
by simply creating a one line file in your $(mhparam path) directory,
and using that file name (in that dir no path is needed)

echo received:split,compress,nowrap > "$HOME/$(mhparam path)/received-only"

(pick your own file name), just once, and then
        
   mhl -form received-only $(mhpath +inbox 794)

(the switch from `` to $() is simply because the latter is in general better
to use, though for a simple case like this it makes no difference really)

and if you're going to do this often, put the one line in a script, ane
replace "+inbox 794" there with "$@" (including the quotes), insert before
that line

        case "$#" in
        0)      set -- cur;;
        esac

(use an "if" instead of case if you prefer, and you can make it fancier
by appending "cur" any time there are no message args, rather than only when
there are no args at all if you want), and you end up with something
that feels and acts just like any other MH command.

It is this kind of thing that makes MH so nice.

kre


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