Skip to content

Instantly share code, notes, and snippets.

@stormouse
Created September 28, 2022 13:20
Embed
What would you like to do?
note taking script
function tn {
local EDITOR=${TAKE_NOTE_EDITOR:-"vim"}
local DIRECTORY=${TAKE_NOTE_DIRECTORY:-"${HOME}/.notes"}
local ACTIVE_NOTE=${TAKE_NOTE_ACTIVE_NOTE:-"note-$(date +%Y-%m-%d)"}
if [ "${#}" == "0" ]; then
${EDITOR} ${DIRECTORY}/${ACTIVE_NOTE}
else
printf "[%s] %s\n" "$(date +%H:%M:%S)" "${*}" | tee -a ${DIRECTORY}/${ACTIVE_NOTE}
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment