title: Bash script throwing syntax error near unexpected token `(' error
body: <p>The following script </p>
  
  <pre><code>jq -r '.[] | $(echo .key | awk -v stg="$STAGE" '{  gsub("/"stg"/COMMON/", "", $0); gsub("/", "_", $0); print $0 })' + "=\"" + (.value|tostring) + "\""' tmp_common_params &gt; tmp_common_params_cleaned
  </code></pre>
  
  <p>is giving error though </p>
  
  <pre><code>$(echo .key | awk -v stg="$STAGE" '{  gsub("/"stg"/COMMON/", "", $0); gsub("/", "_", $0); print $0 })
  </code></pre>
  
  <p>works individually</p>
  
  <pre><code>bash: syntax error near unexpected token `('
  </code></pre>