nmh-workers
[Top][All Lists]
Advanced

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

Re: anno -nodate -component subject -text "hi foo"$'\n'" bar"$'\n'" baz"


From: Ralph Corderoy
Subject: Re: anno -nodate -component subject -text "hi foo"$'\n'" bar"$'\n'" baz"
Date: Sat, 17 Jul 2021 12:26:12 +0100

Hi Tom,

> Consider
>
>     $ anno -nodate -component subject -text "hi foo"$'\n'"  bar"$'\n'"  baz"
>
> I was hoping above would add only one subject header. Is there a way to
> do that?

No, I don't think so.

http://git.savannah.nongnu.org/cgit/nmh.git/tree/uip/annosbr.c#n377
shows -text's argument being written to the field, preceded by the field
name, once for each line-feed-separated chunk.

You could cheat and consider if you know a character won't occur in the
file which you could use as a placeholder for the line feed.

    $ echo a: 1 >1
    $ anno -nodate -component subject -text $'hi foo\r bar\r xyzzy' +. 1
    $ sed -n l 1
    subject: hi foo\r bar\r xyzzy$
    a: 1$
    $
    $ sed -i 's/\r/\n/g' 1
    $ sed -n l 1
    subject: hi foo$
     bar$
     xyzzy$
    a: 1$
    $

-- 
Cheers, Ralph.



reply via email to

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