Skip to content

trel/JSON.sh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON.sh

yo, so it's a json parser written in bash

pipe json to it, and it traverses the json objects and prints out the path to the current object (as a JSON array) and then the object, without whitespace.

$ json_parse < package.json
["name"]	"JSON.sh"
["version"]	"0.0.0"
["description"]	""
["homepage"]	"https://github.com/dominictarr/JSON-sh"
["repository","type"]	"git"
["repository","url"]	"https://github.com/dominictarr/JSON-sh.git"
["repository"]	{"type":"git","url":"https://github.com/dominictarr/JSON-sh.git"}
["bin","json_parse"]	"./bin/json_parse"
["bin"]	{"json_parse":"./bin/json_parse"}
["dependencies"]	{}
#  ... etc

a more complex example:

curl registry.npmjs.org/express | ./bin/json_parse | egrep '\["versions","[^"]*"\]'
... try it and see

Examples

If you have any examples with JSON.sh, streaming twitter, github, or whatever! please issue a pull request and i will include them.

About

a pipeable JSON parser written in Bash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%