Hacker News new | ask | show | jobs
by wwader 709 days ago
jq has quite a few more ways to input things more than from stdin and files. Some examples:

  $ abc=123 jq -cn '$ENV | {abc, othername: .abc}'
  {"abc":"123","othername":"123"}

  $ jq -cn --arg abc 123 '{$abc, othername: $abc}'
  {"abc":"123","othername":"123"}

  $ jq -cn --argjson abc 123 '{$abc, othername: $abc}'
  {"abc":123,"othername":123}