Merged.

Pascal J. Bourguignon [2018-11-18 23:43]
Merged.
Filename
mail-log-trace
diff --git a/mail-log-trace b/mail-log-trace
new file mode 100755
index 0000000..d134721
--- /dev/null
+++ b/mail-log-trace
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+function mail_log_trace(){
+    local message_id="$1"
+    local file="$2"
+
+    grep "${message_id}" "${file}" \
+        | tr ':' ' ' | awk '{print $8;}' \
+        | while read reference ; do
+              grep " ${reference}: " "${file}"
+              printf "\n"
+              process=$( grep "input attribute value: ${reference}" "${file}" \
+                               | tr ':' ' ' | awk '{print $7;}' | sed -e 's/\[/\\[/g' -e 's/\]/\\]/g' )
+              grep " ${process}: " "${file}"
+              printf "\n\n"
+          done
+}
+
+
+function main(){
+    mail_log_trace "$@"
+    exit 0
+}
+
+
+main "$@"
ViewGit