Skip to content

Instantly share code, notes, and snippets.

@carlmartus
Last active September 19, 2018 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlmartus/08281f5d9cf2ca98be0f9c37dc10a90a to your computer and use it in GitHub Desktop.
Save carlmartus/08281f5d9cf2ca98be0f9c37dc10a90a to your computer and use it in GitHub Desktop.
Enter journal directory with todays date and a slug description
#!/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