Created
December 4, 2020 02:43
-
-
Save brunoluz/8ecbe94d4c0ed5904d4ec0f81417eef5 to your computer and use it in GitHub Desktop.
To write stdin in a daily log basis. Usage: {command} | ./std_handler.sh {log_filename}
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
#!/bin/bash | |
while read line; do | |
echo "${line}" | tee -a "$1.$(date '+%Y%m%d').log" | |
done < /dev/stdin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment