log output with timestamps
[Arduino] / Desk_LED_dimmer / fade.sh
1 #!/bin/sh -e
2
3 microcom -p /dev/ttyUSB1 | \
4 while IFS= read -r line; do printf '[%s] %s\n' "$(date '+%Y-%m-%d %H:%M:%S')" "$line"; done | \
5 tee -a /tmp/fade.log
6
7 #gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' | \
8