Created
November 21, 2017 19:24
-
-
Save dennisjbell/9ff1f4eb5e8fa47abf84301f7830a36d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat > json | |
[{ | |
"values": [ | |
{ | |
"skip_ssl_validation": false | |
} | |
], | |
"default": false, | |
"example": null | |
}] | |
$ cat json | jq --arg k skip_ssl_validation '(.[]| select(.values[]|has($k)).default) |= true' | |
jq: error (at <stdin>:8): Invalid path expression near attempt to access element "default" of {"values":[{"skip_ssl_vali... | |
$ cat json | jq --arg k skip_ssl_validation '(.[]| select(.values[]|has($k)).default)' | |
false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment