diff --git a/note b/note new file mode 100755 index 0000000..9750272 --- /dev/null +++ b/note @@ -0,0 +1,29 @@ +#!/bin/bash + +# Check if there is any arguments, if there is append all of it. +if [ "$1" == "less" ]; then + less ~/notefile + exit 1 +elif [ "$1" != "" ]; then + date >> ~/notefile + echo "$@" >> ~/notefile + exit 1 +fi + +echo 'Enter input or type :exit or :q to exit. Type :less to show the notefile.' + +read input + +if [ "$input" != ":exit" ] && [ "$input" != ":q" ]; then + date >> ~/notefile +fi + +while [ "$input" != ":exit" ] && [ "$input" != ":q" ]; do + if [ "$input" == ":less" ]; then + less ~/notefile + else + echo "$input" >> ~/notefile + fi + read input +done +