Hacker News new | past | comments | ask | show | jobs | submit login
JSON.sh: a JSON parser written in bash (github.com/dominictarr)
88 points by wyclif on Oct 25, 2011 | hide | past | favorite | 13 comments



I have been using jsonpipe lots, it is deeply useful. I use it to use RESTful services as if they were system processes. Also try to use it with something like resty (https://github.com/micha/resty) to really make your life easier.


For more elaborate stuff, you can also use jshon (http://kmkeen.com/jshon/).


Whoah - Resty is awesome. Wish I'd known about it before


You can also use the python json.tool

    $ echo '{"json":"obj"}' | python -mjson.tool
    {
        "json": "obj"
    }
http://docs.python.org/library/json.html


Awesome. Been working with a lot of APIs, and I also looked for a way to print it out better in terminal. I found an alternative. If you have python, you can pipe it to -mjson.tool and it will pretty print it in the terminal.

http://stackoverflow.com/questions/352098/how-to-pretty-prin...


like the idea.. and Id really like to see a fully javascript unix shell.

Using mongo, node.js for real work, I find this a really practical environment, and I often write little 'perl' {java}scripts for text/data wrangling.

I wrote a little utility that has a jsonpath-like syntax to descend down into json docs in mongo from the command line, use that a lot.


I can see this being useful. I use bash a lot to deploy small projects, find it's much easier to get a continuous deployment up and running than the fancier tools out there, in the early stages at least.


Thanks a lot!

I cannot really say how much I needed this. Just yesterday I was writing a bash script for one of my side-projects and I wrote a ruby script just to parse JSON and called that ruby script within bash.


Very cool, I love the idea of piping JSON. Thank you


It's probably pretty rare, but I actually had a reasonable use case for something like this some months ago. Worked around it in other ways in the end.

Wouldn't want to use this for any serious work without any clear license, though...


Licence seems pretty clear:

"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."

https://github.com/dominictarr/JSON.sh/blob/master/LICENCE


he was writing before the commit with the licence was pushed.


it is now MIT licenced.

yeah, I think there are plenty of reasonable uses for bash, like before any thing else is installed... aka, devops.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: