removed the 'function' keyword before declaring a function as is not needed.
[bash-notes.git] / SOURCE / CORE / core-remove.sh
index 5776bbc..7bbf8c4 100644 (file)
@@ -1,4 +1,4 @@
-function rmnote() {
+rmnote() {
        # remove eventually existing temp DB file
        if [[ -f $TMPDB ]]; then
                rm $TMPDB
@@ -29,6 +29,7 @@ function rmnote() {
                if [ ! "$OK" ]; then
                        echo "invalid note \"$NOTE\""
                        echo "Use the note ID that you can fetch after listing your notes"
+                       sleep 1
                        exit 1
                fi
 
@@ -43,8 +44,11 @@ function rmnote() {
                        mv $TMPDB $DB
                        rm $NOTESDIR/$FILE
                        echo "Deleted note $TITLE"
+                       sleep 1
+                       exit
                else
                         echo "note not found"
+                        sleep 1
                         exit 1
                fi
        fi