mquote: extract from mcomp, refine

pull/2/head
Christian Neukirchen 8 years ago
parent e7969bf054
commit 2a9c1668eb

@ -76,10 +76,7 @@ fi
msgid
echo
echo "$(mhdr -d -h from "$1") wrote:"
mshow -R "$1" |
sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' |
sed 's/^/> /'
mquote "$1"
echo
esac

@ -0,0 +1,12 @@
#!/bin/sh
# mquote MSG - format MSG as a quotation
: ${from=$(mhdr -d -h x-original-from "$1")}
: ${from=$(mhdr -d -h from "$1")}
: ${from=Someone}
echo "$from wrote:"
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 >
Loading…
Cancel
Save