Created
April 20, 2019 04:38
-
-
Save akr4/3782cba821d7711c724062d3da0df599 to your computer and use it in GitHub Desktop.
list all paths from a json
This file contains hidden or 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
# https://github.com/stedolan/jq/issues/243#issuecomment-48470943 | |
jqpath () { | |
jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment