function create(){ if [ -z "$CREATE" -a -z "$EDIT" -a -z "$PRINT" ]; then #If no action specified, print help and exit help exit elif [ "$CREATE" == "TRUE" ]; then if [ -e $NOTE -o -e ${NOTE%.*} ]; then echo "" echo "ERROR: Note already exists" echo "Hint: use -e to edit the note." echo "" exit else #Create any necessary folders mkdir -p $NOTEDIR #Fill in title echo "TITLE: $NAME" > $NOTE #Fill the second line with the date echo "DATE: $(date)" >> $NOTE if [ "$ENCRYPTION" == "TRUE" ]; then if [ $EDIT == "FALSE" ]; then openssl enc -aes-256-cbc -salt -in $NOTE -out ${NOTE%.*} -pass pass:$ENC_KEY fi fi fi fi }