title: Read line and compare string
body: <p>Trying to create a bash script which reads in a file (argument 1) line by line. The script will only echo the line if it contains a keyword which matches one of the search strings. So far what I have is:</p>
  
  <pre><code>#!/bin/bash
  searchString1="TASK"
  searchString2="WD's"
  
  while read line
  do
      name=$line
      if [[ $searchString1 == *"$name"* ]] ; 
      then
          echo $name;
      elif [[ $searchString2 == *"$name"* ]] ; 
      then
          echo $name;
      fi 
  done &lt; $1
  </code></pre>
  
  <p>Script is run as:</p>
  
  <pre><code>chmod +x parser_script.sh
  ./parser_script.sh filename.txt    
  </code></pre>
  
  <p>This bash script is not detecting the search strings.
  Any idea how to resolve this? Thanks</p>