Question : BASH - Shell Script  - Help with simple menu script to CAT txt file and return values into variables and menu options.

Can someone help me create a BASH shell script that reads a text file with entries like below. And creates a menu.

Basicaly the script would read the txt file for the site names and output a menu with the sites like so:

Select a site:
1)SiteBob
2)SiteTom
3)SiteJoe
4)SiteBill

Depending on the site select it will store these variables:
$DNS1
$DNS2
$TIMEZONE

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
[SiteBob]
DNS1:"10.2.0.1"
DNS2:"10.2.0.2"
TIMEZONE:"Central Standard Time"
[SiteTom]
DNS1:"10.2.0.3"
DNS2:"10.2.0.4"
TIMEZONE:"Eastern Standard Time"
[SiteJoe]
DNS1:"10.2.0.5"
DNS2:"10.2.0.6"
TIMEZONE:"Pacific Standard Time"
[SiteBill]
DNS1:"10.2.0.7"
DNS2:"10.2.0.8"
TIMEZONE:"Central Standard Time"
Open in New Window Select All

Answer : BASH - Shell Script  - Help with simple menu script to CAT txt file and return values into variables and menu options.

max=`wc -l filename | cut -d ' ' -f 1`
Random Solutions  
 
programming4us programming4us