#!/usr/bin/env bashfunctionprint(){echo-e"\e[1;34m${*}\e[0m"}functionprompt(){whiletrue;doread-r-p"→ $1 [y/N] "answer
case${answer}in[Yy]*)return0;;[Nn]*)return1;;*)print_error"Please answer y/Y or n/N";;esacdone}functionmain(){PS3="Select a mode: "selectchoiceinapplyrollback;docase${choice}inapply)print"Running function _apply"break;;rollback)ifprompt"Are your sure? ";thenprint"Running function _rollback"breakfi;;*);;esacdone}main