Skip to content

Instantly share code, notes, and snippets.

@eqyiel
Created December 3, 2019 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eqyiel/3c9c4ea5254e2059881a0cbcb8700392 to your computer and use it in GitHub Desktop.
Save eqyiel/3c9c4ea5254e2059881a0cbcb8700392 to your computer and use it in GitHub Desktop.
#!/usr/bin/env jq --raw-output --from-file --stream
. as $in
| select(length > 1)
| (
.[0] | map(
if type == "number"
then "[" + @json + "]"
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