Please explain how to use the grep command to extract specific text from the following json -
{"result":"Customer information saved successfully with Customer id :59 and version :1","status":{"responseCode":200,"result":null,"responseMessage":"Success","responseType":"info"}}
After some searches, this seems to be possible with grep with regex. But that does not work. Could you point out the error.
cat response.txt | grep -Po '(?<="Customer id ":)[0-9]+'
Assumption: response.txt contains the above json.
If yes, please explain.
source
share