make getpeername() return the original socket address which before it was intercepted
[hband-tools.git] / user-tools / timestamper
blob08330ded9d149132e2f5cdc83da5d87ca620e204
1 #!/usr/bin/env perl
3 use POSIX qw/strftime/;
5 $fmt = $ENV{'TIMESTAMP_FMT'} || '%F %T %z';
8 while(<STDIN>)
10 print strftime($fmt, localtime);
11 print "\t";
12 print $_;
16 __END__
18 =pod
20 =head1 NAME
22 timestamper - Prepend a timestamp to each input line
24 =head1 ENVIRONMENT
26 =over 4
28 =item TIMESTAMP_FMT
30 Timestamp format, see strftime(3).
31 Default is "%F %T %z".
33 =back
35 =head1 SEE ALSO
37 ts(1) from moreutils
39 =cut