Skip to content

Instantly share code, notes, and snippets.

@xvzftube
Created November 11, 2020 00:41
Show Gist options
  • Save xvzftube/781d929a8a7cd1ee5d3d69e9ac77c1c7 to your computer and use it in GitHub Desktop.
Save xvzftube/781d929a8a7cd1ee5d3d69e9ac77c1c7 to your computer and use it in GitHub Desktop.
#!/bin/bash
jq '. as $in
| reduce (.[0] | keys_unsorted[]) as $k ( {};
.[$k] = ($in|map(.[$k] | (tonumber? // .))))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment