Skip to content

Instantly share code, notes, and snippets.

@dliggat
Created July 13, 2013 14:55
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 dliggat/5990988 to your computer and use it in GitHub Desktop.
Save dliggat/5990988 to your computer and use it in GitHub Desktop.
A small bash function to consistently name 'paperless' documents.
# A consistent title for 'paperless' documents.
# Usage:
# $ title Apple ipod Receipt
# $ [2013-07-08 => apple ipod receipt] copied to clipboard.
# Then paste directly into Evernote, etc.
function title {
title_str=`date '+%Y-%m-%d'`
title_str="$title_str =>"
while [ $1 ]
do
lower=`echo $1 | awk '{print tolower($0)}'` # Lower() the string, purely for consistency.
title_str="$title_str $lower"
shift
done
title_str="$title_str (Paperless)"
echo $title_str | pbcopy
echo "[$title_str] copied to clipboard."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment