Skip to content

Instantly share code, notes, and snippets.

@jhidalgo3
Created September 9, 2020 07:21
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 jhidalgo3/b28146065f0fb8b69d23588d2c703620 to your computer and use it in GitHub Desktop.
Save jhidalgo3/b28146065f0fb8b69d23588d2c703620 to your computer and use it in GitHub Desktop.
jq Cheat Sheet

jq Cheat Sheet

Export environment variable from json

$ jq -r '. | to_entries[] | "export \(.key)=\(@sh "\(.value)")"' ~/tmp/x.json
export URL='https://foo:bar@example.com/'
export OTHER='foo " bar '\''baz'\'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment