I am writing a shell script to run some api's. It return response fine but i need some specific parameter to grep from the response and want to save in file. My script look like
#!/bin/sh
response=$(curl 'https://example.com' -H 'Content-Type: application/json' )
echo "$response"
reponse is something like
{
status:"success",
response:{
"target":"",
"content":"test content"
}
}
Response is fine and i am able to write whole response in file but My requirement is to save only "content" inside "response" object using the script. which i need for another api. Note: I cannot change api responses as I am working third party api's;
Thank you