Skip to content

Pass jq's input on the command line? #3107

Closed Answered by wader
StephenWall asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, there is --argjson name value

$ jq -n --argjson data '{"name":"program","version":"1.2.3"}' '$data'
{
  "name": "program",
  "version": "1.2.3"
}
$ jq -n --argjson data '{"name":"program","version":"1.2.3"}' '$data.version'
"1.2.3"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by StephenWall
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants