Created
June 22, 2019 19:26
-
-
Save simonw/0d5c3c0c066a6ae932e7c5936159750f to your computer and use it in GitHub Desktop.
I have this in ~/bin/catjq - chmod 755 - from https://news.ycombinator.com/item?id=20246957
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
#!/usr/local/bin/jq -rf | |
tostream | |
| select(length > 1) | |
| ( | |
.[0] | map( | |
if type == "number" | |
then "[" + tostring + "]" | |
else "." + . | |
end | |
) | join("") | |
) + " = " + (.[1] | @json) | |
# https://news.ycombinator.com/item?id=20246957 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment