I am trying to create a menu script that will execute a command when the option is selected. This is what I have so far.
#!/bin/bash
PS3='Please enter you choice: '
options=("Option 1 - File Directory?" "Option 2 - Run MyScript?" "Option 3 - ?" "4 - Quit")
Select opt in "${options[@]}"
do
case $opt in
"Option 1 - File Directory?")
echo "you chose option 1"
;;
"Option 2 - Run MyScript?")
echo "you chose option 2"
;;
"Option 3 - ?")
echo "you chose option 3"
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done
Selecttoselectand"Quit"to"4 - Quit"or otherwiseecho $PWDto print current directory,path_to_the_scriptto run a script