title: Get json field value with JQ from different directory
body: <p>Title may be incorrect as I'm not actually sure where this is failing. I have a bash script running in one directory, and a JSON file I need a value from in a different directory. I want to copy the value from the external directory into an identical JSON file in the current directory.</p>
  
  <p>I'm using jq to grab the value, but I can't figure out how to grab from a directory other than the one the script is running in. </p>
  
  <p>The relevant bits of file structure are as follows;</p>
  
  <pre><code>cloudformation
    - parameters_v13.json
  environment_files
    - prepare_stack_files.json (the script this is run from)
    - directory, changes based on where the script is pointed
        - created directory where created files are being output
           - GREPNAME_parameters.json
  </code></pre>
  
  <p>The chunk of the JSON file I'm interested in looks like this;</p>
  
  <pre><code>[ 
  {
     "ParameterKey": "RTSMEMAIL",
     "ParameterValue": "secretemail"
    }
  ]
  </code></pre>
  
  <p>The script needs to get the "secretemail" from <code>cloudformation/parameters_v13.json</code>  and paste it into the matching RTSMEMAIL field in the <code>GREPNAME_parameters.json</code> file. </p>
  
  <p>I've been attempting the following with no luck - nothing is output. No error message either, just blank output. I know the GREPNAME path is correct because it's used elsewhere with no issues.</p>
  
  <pre><code>jq --arg email "$EMAIL" '(.[] | select(.ParameterKey == "RTSMEMAIL") | .ParameterValue) |= $email' ../cloudformation/parameters_v13.json | sponge ${GREPNAME}_parameters.json
  </code></pre>