Created
May 29, 2013 17:13
-
-
Save pcarrier/5671999 to your computer and use it in GitHub Desktop.
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
bash-3.2$ cat foo.json | |
{ | |
"a":"hello world", | |
"b":"bar" | |
} | |
bash-3.2$ eval $(ruby -rshellwords -rjson -e 'JSON::load(STDIN).each {|k,v| puts "export #{Shellwords.shellescape(k)}=#{Shellwords.shellescape(v)}"}' < foo.json) | |
bash-3.2$ env|grep -E '^[ab]=' | |
a=hello world | |
b=bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment