#!/bin/bash

TMPFILE=$TMPDIR/stamptee.pl

cat >$TMPFILE <<EOF
#!/usr/bin/perl -w
# This is timestamp.pl

use strict;

my \$line=undef;
my \$stamp;
while (defined (\$line = <>)) {
        \$stamp = localtime (time ());
        \$| = 1;
        print ("\$stamp; \$line");
        \$| = 0;
}
EOF

chmod +x $TMPFILE

/root/TestIo.sh 2>&1 | $TMPFILE > /root/logs/TestIo_${HOSTNAME}_$(date +%F_%H%M).log

