Skip to content

Instantly share code, notes, and snippets.

@khaliqgant
Created April 21, 2022 10:14
Show Gist options
  • Save khaliqgant/f0a7a0e92f087151e7176c73c90aa1ac to your computer and use it in GitHub Desktop.
Save khaliqgant/f0a7a0e92f087151e7176c73c90aa1ac to your computer and use it in GitHub Desktop.
[JQ Boolean to Integer] Convert a boolean to an integer #jq #cli
cat customers/develop.json | jq '. [] | select(.creates_infrastructure_foundation == true)' | jq 'if .run_edge then 1 else 0 end'
Source: https://www.garysieling.com/blog/jq-boolean-integer/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment