confirm_question(){ read -p "You are sure? [y/N]" answ if [[ $answ == "y" ]] || [[ $answ == "Y" ]]; then return 0 elif [[ $answ == "n" ]] || [[ $answ == "N" ]] || [[ $answ == "" ]];then echo "Operation $1 canceled!" read -n 1 -s -r -p "Press any key to continue" return 1 else confirm_question fi }