Any way to parse json in bash terminal

0 votes
30 views
asked Mar 14 by anonymous

Is there any library/package written for bash console terminal to parse json file.

1 Answer

0 votes
answered Mar 14 by anonymous

Yes JSON.sh you can parse json in ash, bash, dash and zsh using this package

Installations

>NPM : npm install -g JSON.sh
>PIP : pip install git+https://github.com/dominictarr/JSON.sh#egg=JSON.sh
>Archlinux : yaourt -Sy json-sh

Usage

json_parse < package.json
["name"]  "JSON.sh"
["version"]  "0.0.0"
["description"]  ""
["homepage"]  "http://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"]  "./JSON.sh"
["bin"]  {"json_parse":"./JSON.sh"}
["dependencies"]  {}
Welcome , qPocho is an online community for programmers share there knowledge.
...