I currently have the code
descarray=($(grep -oP "(?<=description\"\:)(.*?)(?=\}})" descfile.json))
but when I try this I get the match correctly but since it is a string with whitespace, it separates each word as element in array.
Example of string that match would be:
"*No_Request_Validation* issue exists @ some other information here""another example goes here"
but what I would get is
"*No_Request_Validation*
issue
exists
@
some
...
There are quotes at the start and at the end of each required elements and I would like to separate them with it. for example:
descarray[0]: "*No_Request_Validation* issue exists @ some other information here"
descarray[1]: "another example goes here"
jq .[].description descfile.jsonmight be more robust