mblaze/mquote

13 lines
384 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"
2016-08-01 16:00:52 +00:00
mshow -R "$1" |
sed -n '/^-- $/!p;//q' | # strip signature
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' | # strip empty lines
sed 's/^/> /' # prefix with >