Created
March 25, 2013 16:21
-
-
Save hfs/5238365 to your computer and use it in GitHub Desktop.
Prepend the current timestamp in ISO8601 format in front of every line of output. Separator is an optional parameter, default is tab.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -p | |
use POSIX; | |
BEGIN { | |
$| = 1; | |
$separator = shift or $separator = "\t"; | |
} | |
print strftime("%Y-%m-%dT%H:%M:%S", localtime), $separator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment