Can't locate common/sense.pm in @INC (you may need to install the common::sense module) (@INC entries checked: /usr/local/lib/perl5/site_perl /usr/local/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at /usr/lib/perl5/vendor_perl/JSON/XS.pm line 90.
BEGIN failed--compilation aborted at /usr/lib/perl5/vendor_perl/JSON/XS.pm line 90.
Compilation failed in require at /usr/bin/json_xs line 153.
BEGIN failed--compilation aborted at /usr/bin/json_xs line 153.
Options (4)
| Option | Description | Source |
|---|
-v | Be slightly more verbose. | man |
-f fromformat | Read a file in the given format from STDIN. | man |
-t toformat | Write the file in the given format to STDOUT. | man |
-e code | Evaluate perl code after reading the data and before writing it out again - can be used to filter, create or extract data. | man |
Examples (7) from the manual page, untested
json_xs -t none <isitreally.json<src.json json_xs >pretty.json
"JSON Lint" - tries to parse the file isitreally.json as JSON - if it is valid JSON, the command outputs nothing, otherwise it will print an error message and exit with non-zero exit status.json_xs -f storable-file <file
Prettify the JSON file src.json to dst.json.json_xs -f storable-file -t yaml <file
Read the serialised Storable file file and print a human-readable JSON version of it to STDOUT.json_xs -f none -e '$_ = [1, 2, 3]'
Same as above, but write YAML instead (not using JSON at all :)<torrentfile json_xs -f bencode -e '$_ = join "\n", map @$_, @{$_->{"announce-list"}}' -t string
Dump the perl array as UTF-8 encoded JSON text.lwp-request http://cpantesters.perl.org/show/JSON-XS.json | json_xs
Print the tracker list inside a torrent file.
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.