Skip to content

Instantly share code, notes, and snippets.

@utahta
Last active April 11, 2018 10:44
Show Gist options
  • Save utahta/b3958aef7612dc59837236835018857c to your computer and use it in GitHub Desktop.
Save utahta/b3958aef7612dc59837236835018857c to your computer and use it in GitHub Desktop.
json to environment variables using jq.
{
"aaa": "one",
"bbb": "two",
"ccc": "three"
}
#!/bin/bash
jq -r 'to_entries | .[] | .key + "=\"" + .value + "\""' foobar.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment