Created
February 4, 2022 17:19
-
-
Save peterdemin/9f1281e54f7e141b221c0c326fe4b7fa to your computer and use it in GitHub Desktop.
SH script to append text to a file and synchronize it using git
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
#!/bin/sh | |
DIARY_DIR=~/diary | |
DIARY_FILE=README.md | |
cd ${DIARY_DIR} | |
git pull -q | |
echo >> ${DIARY_FILE} | |
date >> ${DIARY_FILE} | |
echo >> ${DIARY_FILE} | |
echo "$1" >> ${DIARY_FILE} | |
git commit -qam "logged from shell" | |
git push -q | |
echo "Journaled" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment