Skip to content

Instantly share code, notes, and snippets.

@semifor
Created November 12, 2010 21:29
Show Gist options
  • Select an option

  • Save semifor/674716 to your computer and use it in GitHub Desktop.

Select an option

Save semifor/674716 to your computer and use it in GitHub Desktop.
Create/edit a journal entry for the current date
#!/bin/sh
#
# Edit a "journal file" in YYYY-MM-DD.txt format for the current date in
# ~/writings/journal or the specified directory (use '.' for the current
# directory).
EXT="txt"
BASE=$(date +%Y-%m-%d)
DIR=${1:-~/writings/journal}
exec ${EDITOR:=vim} "$DIR/$BASE.$EXT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment