Created
November 22, 2017 18:25
-
-
Save EntropyWorks/fba55771075d5ab0a0cda7338c3befee to your computer and use it in GitHub Desktop.
Timestamp output
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
# Not originally created by me btw. | |
# Handy python timestamp trick | |
function p-timestamp() { | |
python -c 'import sys,time;sys.stdout.write("".join\ | |
(( " ".join((time.strftime("[%Y-%m-%d %H:%M:%S]", time.localtime())\ | |
, line)) for line in sys.stdin )))' | |
} | |
## Custom echo that adds a timestamp | |
function echo() { | |
echo $1 | p-timestamp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment