title: Convert bash array to json array and insert to file using jq
body: <p>Given a bash array, how to convert it to a JSON array in order to output to a file with jq?</p>
  
  <p>Additionnally: is there a way to keep the server_nohup array unchanged instead of re-writing the whole json file each time?</p>
  
  <pre><code>newArray=(100 200 300)
  jq -n --arg newArray $newArray '{
      client_nohup: [ 
          $newArray
      ],
      server_nohup: [
  
      ]
  }' &gt; $projectDir/.watch.json
  </code></pre>
  
  <p>Current output:</p>
  
  <pre><code>{
  "client_nohup": [
      "100"
  ],
  "server_nohup": []
  }
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>{
  "client_nohup": [
      100,
      200,
      300
  ],
  "server_nohup": []
  }
  </code></pre>