nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Getting a list of message numbers into a script

2013-10-27 11:24:11
Hi Norm,

Norm wrote:
        $(mhpath first:3 17 last:4| sed -e "s@.*/@@" -e "s@\n@@"

That second sed command isn't doing anything;  there's no linefeed at
the end of sed's pattern space after a line is read in as it is stripped
off from the input before being put there and added again when the
pattern space is printed.  Also, you often don't need to try and get rid
of them, putting all of them on one line, for later processing of the
list of message numbers.

    $ foo=$(seq 3)
    $ for n in $foo; do echo $n; done
    1
    2
    3
    $

David wrote:
Yes, use pick:

    $(pick first:3 17 last:4)

It's worth reading pick(1) to see why this might not list the numbers,
i.e. a `-seq lp' in your ~/.mh_profile, and when it might print `0', an
invalid message number.

Cheers, Ralph.

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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