Skip to content

Instantly share code, notes, and snippets.

@maxrp
Last active August 29, 2015 14:19
Show Gist options
  • Save maxrp/0486ace9974619cc49ff to your computer and use it in GitHub Desktop.
Save maxrp/0486ace9974619cc49ff to your computer and use it in GitHub Desktop.
A simple logbook
#!/bin/bash
## Usage: . new-case 'Investigating whacky happenstance.'
date=`date +%Y-%m-%d`
if [ -d $date ]; then
echo "Case ${date} exists."
cd $date
else
echo "Starting record for ${date}."
mkdir -p $date/{raw,processed}
echo $1
if [ ! -z $1 ]; then
echo "## Summary: ${@}" >> $date/notes.txt
else
touch $date/notes.txt
fi;
export PS1="<$date> ${PS1} "
cd $date
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment