I wrote a script that uses CASE for picking menu options and continuously loops until the user inputs a "0" or a selection that is invalid.
I just want it so if I (or somebody else) forgets what the choices are, then by just hitting the 'enter' key it will print the menu options again...
I just want it so if I (or somebody else) forgets what the choices are, then by just hitting the 'enter' key it will print the menu options again...
Code:
echo "1 - Slots Available in PX720 Library"
echo "2 - Available Scratch in PX720 Library"
echo "3 - Display Active Jobs"
echo "4 - Perform Inventory PX-720 Library"
echo "5 - Run Test Backup on Quantum PX-720"
echo " "
echo "0 - Exit"
echo " "
while [[ ${mytype} != "0" ]] do
print -n "\nEnter option number from above list: ";read var
EMAIL_LIST=nathan.kippen@csd.disa.mil
case $var in
1) mytype=availableSlots;;
2) mytype=availableScratch;;
3) mytype=activeJobs;;
4) mytype=inventoryPX;;
5) mytype=quantumTest;;
0) mytype="0";;
*) echo no valid selection, exiting script ; exit;;
esac