Hi All,
I am trying to use the select command & the menu.
below mention is my script
#!/bin/bash
2
3 PS3="Is today your birthday? " #PS3 system variable
4
5 echo "\n"
6
7
8 select menu_selection in YES NO QUIT
9 do
10
11 case $menu_selection in
12 YES) echo "\nHAPPY BIRTHDAY !!!\n"
13 ;;
14 NO) echo "\nIt is someone's birthday today..........\
15 Sorry it is not yours\n"
16 ;;
17 QUIT) echo "\nLater tater !\n "
18 break
19 ;;
20 *) echo "\n Invalid Answer....please try again \n"
21 ;;
22 esac
23 done
I am getting a different kind of output
[test1]$ ./SelectMenu
\n
1) YES
2) NO
3) QUIT
Is today your birthday? YES
\n Invalid Answer....please try again \n
Is today your birthday? NO
\n Invalid Answer....please try again \n
Is today your birthday? QUIT
\n Invalid Answer....please try again \n
Is today your birthday? 3
\nLater tater !\n
[test1]$
kindly let me know where am I going wrong?