mblaze/mquote
2016-08-08 13:32:43 +02:00

13 lines
375 B
Bash
Executable File

#!/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 >