Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 524

How to join a string onto the output from an array

$
0
0

Let's say this is my output from an aws-cli command.

{"imageIds": [        {"imageDigest": "sha256:9"        },        {"imageDigest": "sha256:5"        },        {"imageDigest": "sha256:46","imageTag": "latest"        }    ]}

Using:

--query="imageIds[?imageTag != 'latest'].imageDigest"

Gives me ["sha256:9", "sha256:5", "sha256:46"].

How do I join an additional string to that list, either using the query, jq or bash, so it looks like["X sha256:9", "X sha256:5", "X sha256:46"]?


Viewing all articles
Browse latest Browse all 524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>