Last active
April 11, 2018 10:44
-
-
Save utahta/b3958aef7612dc59837236835018857c to your computer and use it in GitHub Desktop.
json to environment variables using jq.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"aaa": "one", | |
"bbb": "two", | |
"ccc": "three" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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