Created
April 21, 2017 06:41
-
-
Save joshwnj/58e3cdac8b7ccf4c41fcff2b3ad3189e to your computer and use it in GitHub Desktop.
very simple bash script to write a new blog post
This file contains hidden or 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/bash | |
YYYY=$(date +%Y) | |
MM=$(date +%m) | |
DD=$(date +%d) | |
DIR=posts/$YYYY/$MM/$DD | |
FILE="$DIR/$1.md" | |
mkdir -p $DIR | |
echo "# $1" > $FILE | |
$EDITOR $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment