Actions and syntax
--from-json:
Function:
json_to_arrArguments:<JSON input><array name>Supported options: —no-validate
--to-json:
Function:
arr_to_jsonArguments:<array name>Notes: requires bash2json to be sourced and executed as function
--query:
Function:
json_queryArguments:<JSON input><query><query>syntax:
<key>.<subkey?>When querying arrays:
<key[index]>.<subkey?> ...Since v3.6.0, multiple indexes are supported. If indexes are split with ,, they are put in one line, if ; is used, output values are split through newline:
<key[index1,index2]>.<subkey?> ...# "value1" "value2"OR<key[index1;index2]>.<subkey?> ...# "value1"# "value2"Also since v3.6.0 multiqueries are fully supported. If queries are delimited with space, output values are split with space, if delimeter is ; , output values are split with newline:
<key1> <key2> ...# "value1" "value2"OR<key1>; <key2> ...# "value1"# "value2"Supported options: -r|—raw, —no-validate
--append:
Function:
json_appendArguments:<JSON input>keyvalue?keysyntax:
<key name>([index]?)(.<subkey name>([index]?)?)?...Supported options: —no-validate Notes: If input is an array,
keycan be JSON object and value is optional. If both key & value are present, they will be added as{ key: value }
--trim:
Arguments
<JSON input>Supported options: —no-validate
--pretty:
Arguments:
<JSON input>Supported options: —no-validate
--validate
Arguments
<JSON input>