log output with timestamps
[Arduino] / Desk_LED_dimmer / fade.sh
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 }' | \
+