generate JSON out of command line arguments
问题 I want to create JSON output with jq that looks like this: { "records": [ { "id": "1234", "song": "Yesterday", "artist": "The Beatles" } ] } I assumed I have to twiddle with the "filter" of jq whose concept I don't fully get after reading the doc. This is what I got so far: $ jq --arg id 1234 \ --arg song Yesterday \ --arg artist "The Beatles" \ '.' \ <<<'{ "records" : [{ "id":"$id", "song":"$song", "artist":"$artist" }] }' which prints { "records": [ { "id" : "$id", "song" : "$song", "artist