Last active
September 19, 2018 20:04
-
-
Save carlmartus/08281f5d9cf2ca98be0f9c37dc10a90a to your computer and use it in GitHub Desktop.
Enter journal directory with todays date and a slug description
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
#!/bin/sh -e | |
# Create a new journal directory in ~/journal Specify a journal slug (short | |
# non-space description). A new directory will be created with todays date as a | |
# prefix. | |
if [ -z $1 ]; then | |
echo "Specify journal slug as argument" | |
exit 1 | |
fi | |
TOPIC=$1 | |
DATE=$(date "+%y%m%d") | |
CAT=~/journal/${DATE}_${TOPIC} | |
mkdir -p $CAT | |
cd $CAT | |
echo "Starting new shell in $CAT" | |
$SHELL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment