nmh-workers
[Top][All Lists]
Advanced

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

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


From: Ralph Corderoy
Subject: Re: [Nmh-workers] Getting a list of message numbers into a script
Date: Sun, 27 Oct 2013 16:23:31 +0000

Hi Norm,

> Norm wrote:
> >         $(mhpath first:3 17 last:4| sed -e "address@hidden/@@" -e 
> > "address@hidden@@"

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.



reply via email to

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