2010-12-25 12:44:48 GMT
I've faced a number of times with this scenario: I have some scripts and I wanna log their output in a way to timestamp every lines but I don't wanna write any additional code to achieve the outcome.
Save it as "timestamper" to a directory in your $PATH and make it executable. Using it is a no brainer:
./myscript 2>&1 | timestamper >> myscript.log
Could it be any simpler? I don't think so.