So i got the function RM_OBJ_P which gets called from the menu page PAGE_RM.  This is working, you can enter all the funky filenames you know and if they are in the database, the output gets printed to a text file (just as i want it to be). But if i ever foolishly choose the somehow magical option x (or X) which should call PAGE_RM, the script exits. What have i done wrong?(I also tried to achieve this by using return 0 instead of PAGE_RM)EDIT: Obviously entering xas choice also calls RM_P_* (see added log)RM_OBJ_P() {echo After you have finished, you can find the file here: $ACTIVE_DB/remove.txtechoif [ ! -f file.txt ] ; then    read -p Please enter the name of the file you'd like to check (or x to return):  CHOICE    case $CHOICE in        *) RM_P_N ;;        x|X) PAGE_RM ;;    esacelse    read -p Please enter the name of the file you'd like to check:  CHOICE    echo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >>$ACTIVE_DB/remove.txt    echo If you want to remove $CHOICE, please consider this: >>$ACTIVE_DB/remove.txt    case $CHOICE in        *) RM_P_E;;        x|X) PAGE_RM ;;    esacfi}In case it matters, RM_P_N and RM_P_Eare both like this (and work as intended)RM_P_*() {echo something gets an echo echo echo o o o >file.txtPATH/TO/perl_script.pl $CHOICE database_query >>file.txtRM_OBJ_P}and last but not least, PAGE_RMPAGE_RM() {    clear    while :; do        PRINT_BANNER_S        PRINT_RM_MENU        echo single - view        echo print  - print        PRINT_LINE        echo x      - go back        PRINT_LINE3        read -p CHOICE:  CHOICE            case $CHOICE in                s|S) RM_OBJ ;;                p|P) RM_OBJ_P ;;                x|X) return 0                PRINT_LINE            esac    done}Here the relevant part of the log+ RM_OBJ_P+ echo 'After you have finished, you can find the file here: DB_45763/remove.txt'+ echo+ '[' '!' -f DB_45763/remove.txt ']'+ read -p 'Please enter the name of the file you'\''d like to check: ' CHOICEPlease enter the name of the file you'd like to check: + echo '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'+ echo 'If you want to remove x, please consider this:'+ case $CHOICE in+ RM_P_E+ echo 'If you want to remove x, please consider this:'+ ./files/perls/remove_object.pl x dbi:SQLite:dbname=test.sqlite '' ''
Function does not get called and script exits
bash;scripting;exit