Quantcast
Channel: Passing variable to jq to edit a json file - Unix & Linux Stack Exchange
Browsing all 3 articles
Browse latest View live

Answer by bubonic for Passing variable to jq to edit a json file

Michael Homer has the correct response. I'll post what I was aiming for in relation to op's question. I am trying to modify a permissions graph obtained through a REST API curl call using jq to output...

View Article



Answer by Michael Homer for Passing variable to jq to edit a json file

You can use square bracket indexing on all objects in jq, so [$name] works for what you're trying: jq --arg key1 true --arg name "$name" '.Linux.script_executed[$name] = $key1 ...' This use of square...

View Article

Passing variable to jq to edit a json file

I am trying to pass a variable into jq like this '.Linux.date.$var' so far I have tried quoting them by name which is working fine. But I want to use variable to call them. I have this, which is...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images