title: conditional website scraping with bash
body: <p>The following script scrapes a website for movie titles</p>
  
  <pre><code>#!/bin/bash
  parse_url() {
  ids=$(curl -s "$1" | grep -o -P '(?&lt;=list.php\?mid=)\d+')
  for id in $ids
  do 
  
  titles=$(curl -s "http://subtitle.co.il/view.php?id=$id&amp;m=subtitles#${id#1}" | grep -o -P '(?&lt;=style="direction:ltr;" title=")(.*?)(?="&gt;)')
  for title in $titles 
  if [[ "$title" == *720p* ]]
  then
  echo "$title"
  fi
  done
  done
  echo "done"
  }
  </code></pre>
  
  <p>i want to echo $title only if it contains "720p". when i run the script it returns the following error: syntax error near unexpected token `if'  if [[ "$title" == <em>720p</em> ]]'
    where did i go wrong? thanks</p>