I have a json and I want to grep the website url (http://mywebsite.com), how do i grep that using shell script.
P.S: I know there are tools like 'jq' which could make it easier but I want to do it using sed/awk/grep utilities.
eg: test.json
{
"name" : "xyz",
"age" : "25",
"websiteurl" : "http://mywebsite.com"
}
So far I have tried;
cat test.json | grep -i website* | cut -d ':' -f2
Output:
"http
But when I run the above command as shown above, it also seperates the colon (:) between http and double slash(//) which I dont want. I want the whole url to be stored in a variable.