#!/usr/bin/perl #timestamp.pl ### use Time::HiRes qw(gettimeofday); $|=1; while (<>) { $timestamp = sprintf("%d.%06d", gettimeofday()); print "$timestamp $_"; } exit; --- touch testfile tail -f testfile | timestamp.pl _in another window_ echo 'test' >> testfile (wait a while) echo 'test' >> testfile (wait a few seconds) echo 'test' >> testfile (wait a little while) echo 'test' >> testfile #### 1265405350.420517 test 1265405354.420852 test 1265405356.421037 test 1265405362.421530 test #### :~/bin/timestamp.pl 1265405711.519744 1265405711.784186 1265405711.939817 1265405712.144596 1265405712.355313 1265405712.648788