by atomicstack · 2y ago · 0 comments
echo 'hello world' | ts '[%F %.T]'
[2023-12-30 16:25:40.463640] hello world while read -r line; do printf '%(%F %T %s)T %s\n' "-1" "${line}"; done
as the right-hand side/reader of a shell pipe for most of what ts(1) offers. ("-1" makes the embedded strftime(3) format string assume the current time as its input).