repo.or.cz
/
hband-tools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
make getpeername() return the original socket address which before it was intercepted
[hband-tools.git]
/
user-tools
/
timestamper
blob
08330ded9d149132e2f5cdc83da5d87ca620e204
1
#!/usr/bin/env perl
2
3
use
POSIX qw
/strftime/
;
4
5
$fmt
=
$ENV
{
'TIMESTAMP_FMT'
} ||
'
%F
%T
%z
'
;
6
7
8
while
(<
STDIN
>)
9
{
10
print
strftime
(
$fmt
,
localtime
);
11
print
"
\t
"
;
12
print
$_
;
13
}
14
15
16
__END__
17
18
=pod
19
20
=head1 NAME
21
22
timestamper - Prepend a timestamp to each input line
23
24
=head1 ENVIRONMENT
25
26
=over 4
27
28
=item TIMESTAMP_FMT
29
30
Timestamp format, see strftime(3).
31
Default is "%F %T %z".
32
33
=back
34
35
=head1 SEE ALSO
36
37
ts(1) from moreutils
38
39
=cut