* ifdata: patch from Adam Lackorzynski to translate French error messages
[moreutils.git] / ts
blob42a1ce4e37dcfb80212882990dea8e87be85f48b
1 #!/usr/bin/perl
3 =head1 NAME
5 ts - timestamp input
7 =head1 SYNOPSIS
9 ts [format]
11 =head1 DESCRIPTION
13 ts adds a timestamp to the beginning of each line of input
15 The optional format parameter controls how the timestamp is formatted,
16 as used by L<strftime(3)>. The default format is "%H:%M:%S".
18 =head1 AUTHOR
20 Copyright 2006 by Joey Hess <joey@kitenet.net>
22 Licensed under the GNU GPL.
24 =cut
26 use warnings;
27 use strict;
28 use POSIX q{strftime};
30 my $format="%H:%M:%S";
31 $format=shift if @ARGV;
33 $|=1;
35 while (<>) {
36 print strftime($format, localtime)." ".$_;