3 ms·
There is an easy way to display re-display a lines with a time stamp. While I enjoy seeing people awk, the command is a bit terse. Instead I recommend somethin
by mkovach 6y ago
There is an easy way to display re-display a lines with a time stamp. While I enjoy seeing people awk, the command is a bit terse.
Instead I recommend something like:
tail -f /some/file | perl -nle 'print scalar(localtime),":",$_'
and it a bit easier to type IMHO.
- reacweb 6y agoI fully agree: each time a command in awk or sed or bash becomes complex, it is the right time to switch to perl. Perl does not have all the limitations of (awk, sed, bash) while having concise syntax.