about summary refs log tree commit diff
path: root/mquote
diff options
context:
space:
mode:
Diffstat (limited to 'mquote')
-rwxr-xr-xmquote12
1 files changed, 12 insertions, 0 deletions
diff --git a/mquote b/mquote
new file mode 100755
index 0000000..1a68f50
--- /dev/null
+++ b/mquote
@@ -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 >