Time Cat (tcat) is a timestamping tool for output, which must have been done by many people and in many languages, and I was one of them using Bash three years ago, a script named ts.sh.

But the one comes first that most people know of is a Perl script ts from moreutils. Nonetheless, tcat is written in C, so it should have a better performance and I haven’t seen anyone re-implement such function in C.

Here is a screenshot of three programs:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnFZjvwMBtPdECrWBfZ1tQOcFuePhSjuZ9kSZiSDedQndXVliFFyxMj4eAWYKdpFUnXOipTKr8zkGnQ0u0Vc1GB413JKixNbNrx8Tz_P6HJEcqPpny9f2A5hyphenhyphenqjgIpMw3IVDsZZPTCkTM/s800/2014-02-08--09%253A26%253A40.png

This C code isn’t perfect, the time format currently is hard-coded, not like mine and Perl script, which allow users to change to any format they like. It’s new, so it has a lot potential to grow up to be.

Also it can’t invoke a command, neither can ts, mine is much better in terms of functionality, but since it’s written in Bash, you can expect it wouldn’t do well if there are tons of messages to be stamped.