Assuming the menu could have a variable list of items we can let select build the menu for us.
Sample data:
$ cat accounts.config
www.upwork.com:user1:password1
something.fIvErr.org:user22:password22
One idea using select:
$ cat menu.bash
#!/usr/bin/bash
menu_list='Upwork Fiverr FindACoder'
PS3='Select number: ' # prompt displayed by 'select' command
select option in ${menu_list}
do
break # we don't want an infinite loop that we need to ^C out of
done
echo "Menu number selected: ${REPLY}"
echo "Menu option selected: ${option}"
echo "++++++++++ matching config entry(s):"
grep -i "${option}" accounts.config
Sample runs:
$ menu.bash
1) Upwork
2) Fiverr
3) FindACoder
Select number: 1
Menu number selected: 1
Menu option selected: Upwork
++++++++++ matching config entry(s):
www.upwork.com:user1:password1
$ menu.bash
1) Upwork
2) Fiverr
3) FindACoder
Select number: 2
Menu number selected: 2
Menu option selected: Fiverr
++++++++++ matching config entry(s):
something.fIvErr.org:user22:password22
$ menu.bash
1) Upwork
2) Fiverr
3) FindACoder
Select number: 3
Menu number selected: 3
Menu option selected: FindACoder
++++++++++ matching config entry(s):
OP can add more code to address user picking a non-menu item (eg, 9), parsing the results from the grep, what to do if there's no match in the config file, etc.