I'm facing problem in shell script that read the value from properties file. I'm done with reading the property file by the below code
Property file looks like
Expand|Select|Wrap|Line Numbers
- NODE_NAME=xxxx
- WMQ_CONN_NAME=yyyy
- WMQ_CONN_TYPE=zzzz
Expand|Select|Wrap|Line Numbers
- get_prop(){
- propfile=$1
- key=$2
- grep "^${2}=" ${1}| sed "s%${2}=\(.*\)%\1%"
- }
- NODE_NAME=`get_prop AppServerConfig.properties NODE_NAME`
- WMQ_CONN_NAME=`get_prop AppServerConfig.properties WMQ_CONN_NAME`
- WMQ_CONN_TYPE=`get_prop AppServerConfig.properties WMQ_CONN_TYPE`
Expand|Select|Wrap|Line Numbers
- echo $NODE_NAME $WMQ_CONN_NAME $WMQ_CONN_TYPE
Expected Result:
Expand|Select|Wrap|Line Numbers
- xxxx yyyy zzzz
Expand|Select|Wrap|Line Numbers
- zzzz
Expand|Select|Wrap|Line Numbers
- echo "${NODE_NAME}${WMQ_CONN_NAME}${WMQ_CONN_TYPE}"
Thanks
Raju