messages reader
authorMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Sun, 29 Mar 2009 08:13:34 +0000 (08:13 +0000)
committerMatteo Nastasi (mop) <nastasi@alternativeoutput.it>
Sun, 29 Mar 2009 08:13:34 +0000 (08:13 +0000)
bin/procmsg.sh [new file with mode: 0755]

diff --git a/bin/procmsg.sh b/bin/procmsg.sh
new file mode 100755 (executable)
index 0000000..2eb25be
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+src="$1"
+IFS="
+"
+for i in `cat $src`; do
+    dt="$(echo $i | cut -d '|' -f 1)"
+    user="$(echo $i | cut -d '|' -f 2)"
+    subj="$(echo $i | cut -d '|' -f 3)"
+    mesg="$(echo $i | cut -d '|' -f 4)"
+
+    echo "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"
+    echo "Date :" | tr -d '\n'
+    date -d @$dt
+    echo "User: $user"
+    echo "Subject: $subj"
+    echo -e "$mesg"
+    echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
+done
\ No newline at end of file