Skip to content

Instantly share code, notes, and snippets.

@opqdonut
Created December 12, 2015 19:52
Show Gist options
  • Select an option

  • Save opqdonut/5ecf25762a9c3a24e564 to your computer and use it in GitHub Desktop.

Select an option

Save opqdonut/5ecf25762a9c3a24e564 to your computer and use it in GitHub Desktop.
#!/bin/sh
jq -c 'recurse(.[]? | select((type!="object") or (to_entries | map(.value) | contains(["red"]) | not))) | numbers' < input.12 | awk '{ans += $1} END { print ans }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment