The jq program .dev.projects."$v"
in your example will literally try to find a key named "$v"
. Try the following instead:
jq --arg v "$PRJNAME" '.dev.projects[$v]' config.json
More Related Contents:
- Passing bash variable to jq
- Select objects based on value of variable in object using jq
- jq not working on tag name with dashes and numbers
- Iterating through JSON array in Shell script
- Modify a key-value in a json using jq in-place
- How to convert a JSON object to key=value format in jq?
- How to format a JSON string as a table using jq?
- Exporting JSON to environment variables
- Convert a JSON array to a bash array of strings
- Create JSON using jq from pipe-separated keys and values in bash
- Constructing a JSON object from a bash associative array
- Parsing JSON with Unix tools
- How to convert arbitrary simple JSON to CSV using jq?
- How to merge 2 JSON objects from 2 files using jq?
- Add new element to existing JSON array with jq
- Accessing a JSON object in Bash – associative array / list / another model
- how to parse a JSON String with jq (or other alternatives)?
- Read JSON data in a shell script [duplicate]
- Using jq how can I split a very large JSON file into multiple files, each a specific quantity of objects?
- How to check if element exists in array with jq
- Get outputs from jq on a single line
- How do I update a single value in a json document using jq?
- How to convert a JSON object stream into an array with jq
- How to use jq when the variable has reserved characters?
- How to get key names from JSON using jq
- Escaping characters in bash (for JSON)
- Reusable function to group_by but return an object with group as key
- change json file by bash script
- Parse JSON to array in a shell script
- Split a JSON file into separate files