Skip to content

Instantly share code, notes, and snippets.

@kaosf
Last active December 15, 2015 13:39
Show Gist options
  • Save kaosf/5268786 to your computer and use it in GitHub Desktop.
Save kaosf/5268786 to your computer and use it in GitHub Desktop.
oneliner JSON parser with Ruby
# cat a.json # => {"x": "a", "y": 1, "z": true}
cat a.json | ruby -rjson -e "puts JSON.parse(STDIN.read)" # => {"x"=>"a", "y"=>1, "z"=>true}
# ruby -v #=> ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux]
# on Ubuntu 12.04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment