I have a curl command which returns a single line but having lengthy response body. And need to search for particular string and print the result.
For example, here is the output of curl. Can I use a bash script to print the state value of centos which is "true"? or should I use a different script/program language? The script should basically output as state=true. Note, there are two "state" values in the output
~]# curl -v -k -u test:test https://myurl.com/api/state
"name":"centos","type":"disc","state":true},{"partitions":5},"auth_mechanisms": [{"name":"PLAIN","description":"PLAIN authentication"}], [{"name":"suse","type":"ram","state":true}]