title: How to fix bash script to find regex in another file?
body: <p>I have tried the following file to find a certain regex in a file and echo out some output</p>
  <pre><code>content=`cat $1 `
  
  REGEX_RANGE=&quot;s/COPYRIGHT .*[0-9]{4}-[0-9]{4} alex4200&quot;
  REGEX_SINGLE=&quot;s/COPYRIGHT .*[0-9]{4} alex4200&quot;
  
  if [[ $content =~ $REGEX_RANGE ]];
  then
      echo &quot;File has year range&quot;
  else
      if [[ $content =~ $REGEX_SINGLE ]];
      then
          echo &quot;File has single year&quot;
      else
          echo &quot;No REGEX found&quot;
      fi
  fi
  </code></pre>
  <p>However, when I use this script on a file <code>test.txt</code> with the content</p>
  <pre><code>COPYRIGHT (c) 2020 alex4200
  </code></pre>
  <p>it returns <code>No REGEX found</code>. What am I missing here?</p>