Created
June 7, 2021 14:23
-
-
Save pfeilbr/957cec218eb7db4c02579c900c6aa2d0 to your computer and use it in GitHub Desktop.
markdown notes manipulation
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
cd notes | |
for f in *.md; do | |
first_line=$(head -n 1 $f) | |
if [[ ! $first_line = \#* ]] ; then | |
#echo "${f}" | |
barename=$(basename $f .md) | |
# echo "${barename}" | |
# prepend bare filename as H1 to top of note | |
echo -e "# ${barename}\n\n$(cat $f)" > $f | |
# cp $f tmp | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment