Further to a previous post: -
I wanted to achieve much the same, but only using jq
So here we go: -
ic is images --output JSON | jq -r '.[] | {Name:.name,Architecture:.operating_system.architecture,Status:.status} | select((.Name | contains("ubuntu")) and (.Architecture | startswith("s390x")) and (.Status | startswith("available")))'
which returns: -
{
"Name": "ibm-ubuntu-18-04-1-minimal-s390x-3",
"Architecture": "s390x",
"Status": "available"
}
as opposed to the alternative: -
ic is images | awk '/s390x/ && /ubuntu/ && /available/'
r018-e3d94080-972f-4f18-8a79-60a12d0b61c2 ibm-ubuntu-18-04-1-minimal-s390x-3 available s390x ubuntu-18-04-s390x 18.04 LTS Bionic Beaver Minimal Install 2 public provider none -
No comments:
Post a Comment