Created
February 19, 2024 16:56
-
-
Save Mitrichius/ceed0f0ebf1e5683c3bd72eeb0d4bb15 to your computer and use it in GitHub Desktop.
"On This Day" bash script for daily notes
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
MONTH_DAY=`date +'%m-%d'` | |
YEAR=`date +'%Y'` | |
> ${FILE_RESULT} | |
find "${DIR_PATH}" -maxdepth 1 -type f -name "*-${MONTH_DAY}.md" -type f ! -name "${YEAR}-${MONTH_DAY}.md" -print0 | while read -d $'\0' FILE | |
do | |
FILE_NAME=$(basename "${FILE}") | |
printf "\n\n---\n${FILE_NAME}\n---\n\n" >> ${FILE_RESULT} | |
cat "${FILE}" >> ${FILE_RESULT} | |
done | |
${EDITOR} ${FILE_RESULT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment