Skip to content

Instantly share code, notes, and snippets.

@pcarrier
Created May 29, 2013 17:13
Show Gist options
  • Save pcarrier/5671999 to your computer and use it in GitHub Desktop.
Save pcarrier/5671999 to your computer and use it in GitHub Desktop.
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