mblaze/mquote

13 lines
412 B
Plaintext
Raw Normal View History

2016-08-01 16:00:52 +00:00
#!/bin/sh
# mquote MSG - format MSG as a quotation
2016-08-08 11:32:43 +00:00
: ${from:=$(mhdr -d -h x-original-from "$1")}
: ${from:=$(mhdr -d -h from "$1")}
: ${from:=Someone}
2016-08-01 16:00:52 +00:00
2017-03-26 18:44:10 +00:00
printf '%s wrote:\n' "$from"
{ mshow -R "$1" || mshow -h '' -N "$1"; } |
sed -n '/^-- $/,$!p' | # strip signature
2016-08-01 16:00:52 +00:00
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | # strip empty lines
sed 's/^/> /' # prefix with >