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.

Revisions

  1. zhimoe created this gist Mar 17, 2019.
    11 changes: 11 additions & 0 deletions bash-prepend-text-into-file.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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;