Reading File

Hi All,

I have a requirement to read the file and get the values by passing keys.

File looks like

DBUSER=oradba
SPNAME=usp_get_emp_list
TBNAME=t_emp

I have to parse the file by passing key values(DBUSER, SPNAME, TBNAME) and get the values (oradba, usp_get_emp_list) and assigned to my varaibles

myDBUsr=oradba
mySPNm=usp_get_emp_list

Like passing key to a file and get the corresponding value.

Any example or actual code.

Please help.

source the file.

. filename

echo $DBUSER
echo $SPNAME
echo $TBNAME

please note, if there are other lines/text which is syntactically not correct for scripting or not required to be sourced must be commented by "#"

Thanx it is working