procmail
[Top] [All Lists]

sed-oneliner to unfold a single header

2004-04-07 03:30:08
Because procmail already unfolds header-lines, you are not likely 
to need this:

    sed -e '/^$/q; /^Header-Name/!d; :a'\
        -e 'N; s/\n[[:blank:]]\{1,\}/ /; ta'\
        -e 's/\n.*//;q'

The /^Header-Name/ can be made stronger, like /^Header-Name[[:blank:]]*:/

sed is case-sensitive, so you might need to do 
/^[Cc][Oo][Nn][Tt][Ee][Nn][Tt]-[Tt][Yy][Pp][Ee][[:blank:]]*:/

This sed-oneliner was recently created by Laurent Vogel (and me) 
on the [sed-users] mailinglist. It takes the first occurence of 
a specified header-line and unfolds it. 

-- 
Grtz, Ruud

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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