I have following file1 json:
{
"name": "eye",
"attributes": [
{
"name": "Width",
"value": "1920"
},
{
"name": "Height",
"value": "1080"
},
{
"name": "WinKeyMapping",
"value": "leftwin"
}
],
"starts": [
{
"name": "step1",
"attributeList": [
{
"name": "Command",
"value": "bash"
},
{
"name": "Test",
"value": "none"
}
]
}
]
}
and following filter:
$ jq '.starts[].attributeList[]|select(.name=="Command")' file1
{
"name": "Command",
"value": "bash"
}
$
how could I get whole structure to this selection?
expected output:
{
"starts": [
{
"attributeList": [
{
"name": "Command",
"value": "bash"
}
]
}
]
}