log output with timestamps
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 20 Feb 2016 21:47:55 +0000 (22:47 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 20 Feb 2016 21:47:55 +0000 (22:47 +0100)
Desk_LED_dimmer/fade.sh [new file with mode: 0755]

diff --git a/Desk_LED_dimmer/fade.sh b/Desk_LED_dimmer/fade.sh
new file mode 100755 (executable)
index 0000000..7c7b1e5
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+microcom -p /dev/ttyUSB1 | \
+while IFS= read -r line; do printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done | \
+tee -a /tmp/fade.log
+
+#gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' | \
+