mirror of
https://github.com/jqlang/jq.git
synced 2026-10-30 10:06:03 +00:00
03598bb5d687e3e21dd65cd49386645d9c3a5807
This is useful when one has a database (in JSON form) to query using jq
input data.
% echo '{"a":1, "c":5}' > db.json
% echo '"c"'|./jq --argfile f /tmp/a '$f[.]'
5
% echo '"a"'|./jq --argfile f /tmp/a '$f[.]'
1
% echo '"b"'|./jq --argfile f /tmp/a '$f[.]'
null
%
jq
jq is a command-line JSON processor.
If you want to learn to use jq, read the documentation at http://stedolan.github.com/jq. This documentation is generated from the docs/ folder of this repository.
If you want to hack on jq, feel free, but be warned that its internals are not well-documented at the moment. Bring a hard hat and a shovel. Also, read the wiki: http://github.com/stedolan/jq/wiki
To build jq, run
./configure
make
sudo make install (optionally)
If you've just checked out the latest version from git (rather than using a released source tarball) then you'll need to run this first:
autoreconf
Languages
C
78.7%
M4
6.4%
Shell
6.3%
Yacc
3.2%
jq
1.5%
Other
3.9%