Better HN
topnewbestaskshowjobs
Log inSign up

a1a1a

1 karma · joined Nov 5, 2022 (4y ago) · 1 submissions

Submissions

comment 4y ago · link · parent

One of my favorite shell script snippet is prepending timestamp to every output with the help of ts command of moreutils package, meanwhile write to log file at the same time: https://unix.stackexchange.com/questions/26728/prepending-a-...

exec &> >( ts '[%Y-%m-%d.%H:%M:%S] ' | tee ${LOGFILENAME} )