I have a curl command
curl -u user:password -X POST -k http://artifactory:8081/artifactory/api/search/aql -d "items.find({\"type\" : \"folder\", \"repo\" : \"test-repo\", \"path\" : \""App_7.1.2"\", \"modified\" : {\"\$lt\" : \"2017-05-18\"} })"
The output, that I get looks like this:
{
"results" : [ {
"repo" : "test-repo",
"path" : "App_7.1.2",
"name" : "66",
"type" : "folder",
"size" : 0,
"created" : "2016-05-26T09:40:03.332+03:00",
"created_by" : "user",
"modified" : "2016-05-26T09:40:03.332+03:00",
"modified_by" : "user",
"updated" : "2016-05-26T09:40:03.332+03:00"
},{
"repo" : "test-repo",
"path" : "App_7.1.2",
"name" : "67",
"type" : "folder",
"size" : 0,
"created" : "2016-05-31T19:19:35.040+03:00",
"created_by" : "user",
"modified" : "2016-05-31T19:19:35.040+03:00",
"modified_by" : "user",
"updated" : "2016-05-31T19:19:35.040+03:00"
} ]
I add a grep command to the command above and it starts looking like
curl -u user:password -X POST -k http://artifactory:8081/artifactory/api/search/aql -d "items.find({\"type\" : \"folder\", \"repo\" : \"test-repo\", \"path\" : \""App_7.1.2"\", \"modified\" : {\"\$lt\" : \"2017-05-18\"} })" | grep -oP '\"name\" : \K.*' |tr -d '",'
and I get an output
66
67
So I can make an array from these strings by command:
($(curl -u user:password -X POST -k http://artifactory:8081/artifactory/api/search/aql -d "items.find({\"type\" : \"folder\", \"repo\" : \"test-repo\", \"path\" : \""App_7.1.2"\", \"modified\" : {\"\$lt\" : \"2017-05-18\"} })" | grep -oP '\"name\" : \K.*' |tr -d '",'))
But what I actually need - is to get an array of Strings like path/name.
So it should be in my case
App_7.1.2/66
App_7.1.2/67
Could you tell me, how can I do it? I need to join different strings from output by using grep, is it possible? Thanks in advance