Skip to content

Instantly share code, notes, and snippets.

@zhimoe
Created March 17, 2019 15:23
Show Gist options
  • Save zhimoe/de9b827a0e3eeab8f33a78a153e2cb5d to your computer and use it in GitHub Desktop.
Save zhimoe/de9b827a0e3eeab8f33a78a153e2cb5d to your computer and use it in GitHub Desktop.
bash-prepend-text-into-file
for i in *; do if [ ${i: -3} == ".md" ];
then echo "---
title: '"${i::-3}"'
date: 2019-01-01
tags:
- java
- code
---
$(cat $i)" > $i;
fi; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment