usage: myscript.sh config.json
config.json:
{
"HOST":"abc",
"DB_NM":"xyz",
"USR_NM":"asd",
"PWD":"xxx",
.........
.........
.........
........
}
myscript.sh:
#HOW TO SOURCE THE config.json file?
I would like to use the variables in config.josn file to prepare a query and execute in Linux Shell as show below.
host=$HOST/$DB_NM
usr_nm="--username $USR_NM"
pwd="--password $PWD"
query= "--connect $host $usr_nm $pwd"
eval $query
I am new to shell scripting. Please help me on this.