I am creating a Select menu with a few options and I would like to create a "better" looking interface than just this:
1) Option 1
2) Option 2
3) Option 3
Instead, I would like something like this:
***********
- Cool Script *
- 1) Option 1 *
- 2) Option 2 *
- 3) Option 3 *
************
Can I do this with Select or do I have to use tput or something else? Below is a snippet of my script so far...
PS3="$main_menu_prompt"
select cmd in "Option 1" "Option 2" "Option 3"
do
case $cmd in
"Option 1")
clear
PS3="$submenu_prompt"
select option in "Yes" "No"
do
case $option in
"Yes") print "**Not configured**"
sleep 2
break;;
"No") break;;
*) print "You must enter a valid response!"
sleep 2
clear
submenu;;
esac
done
clear
mainmenu
PS3=$main_menu_prompt;;
I predefined the PS3 prompts since I use them frequently in the script and I wanted the menu to appear everytime the user needed to provide input (to remind them what they are inputing for). I tried redirecting the screen output of the Select line to /dev/null, but ksh has an issue with the ">".
I googled for an answer/hint but I did not have any luck.
Thank you for any help.