#!/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