title: bash: bash script gives Bad substitution error
body: <p>Script:</p>
  
  <pre><code>#!/bin/bash
  
  url=${cat /var/scripts/test.txt | grep -oP '(?&lt;=display_url":")[^"]+'}
  
  for url in $display_urls; do
      curl $url -O /tmp/$url.html
  done
  </code></pre>
  
  <p>This bash script gives me Bad substitution error on Ubuntu. Any help will be highly appreciated.</p>
  
  <pre><code>./script.sh: line 3: ${cat /var/scripts/test.txt | grep -oP '(?&lt;=display_url":")[^"]+'}: bad substitution
  </code></pre>