Last active
September 28, 2021 16:11
-
-
Save wjz1095/2fd2527b554836a59d322d90a1a65b2c to your computer and use it in GitHub Desktop.
Bash Logging
This file contains 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
LOGLOCATION="/var/log/example.log" | |
DATE=$(date) | |
MESSAGE="Your message here" | |
echo $DATE $MESSAGE >> $LOGLOCATION | |
echo "----------------------------" >> $LOGLOCATION |
This file contains 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
$LOGLOCATION="/var/log/example.log" | |
echo "" >> $LOGLOCATION | |
date >> $LOGLOCATION | |
echo "-----MESSAGE HERE-----" >> $LOGLOCATION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment