Skip to content

Instantly share code, notes, and snippets.

@wehrhaus
Last active August 29, 2015 13:57
Show Gist options
  • Save wehrhaus/9755596 to your computer and use it in GitHub Desktop.
Save wehrhaus/9755596 to your computer and use it in GitHub Desktop.
Simple note keeper script. Creates files based on date and timestamps entries.
#!/bin/bash
# Simple note keeper script.
# Creates files based on date and timestamps entries.
# setup date format to ##.##.##
dateStamp=$(date +"%m.%d.%y")
# write note to:
fileName=$HOME/TakeNote/note_${dateStamp}.txt
# get last line of file and display
lastLine=`tail -1 $fileName`
echo Last entry: "$lastLine"
# handle input
read -p "📝: " note
# write to file
echo $(date +"%r"): "$note" >> $fileName
# feedback once note entered
echo "$note" saved to "$fileName"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment