dstamp.pl

This is a perl snippet I use for logging date/time stamps;


$ cat x

this is a file
with
some data in it
typically log file type of stuff
pecan.makuch.org:/mkm/home/mkm
$ cat x | dstamp.pl 
20111103-002836 
20111103-002836 this is a file
20111103-002836 with
20111103-002836 some data in it
20111103-002836 typically log file type of stuff
pecan.makuch.org:/mkm/home/mkm
$ cat scripts/dstamp.pl 
#!/usr/bin/perl

while() {
        $d = `date +%Y%m%d-%H%M%S`;
        chop $d;
        print $d . ' ' . $_;
}
pecan.makuch.org:/mkm/home/mkm
$