title: new to Bash - keep getting Illegal option error
body: <p>I'm quite new to ubuntu and bash scripting and wanted to know why I might be getting this error when using GETOPTS.</p>
  
  <p>here is the code I use to run it.</p>
  
  <pre><code>sh /home/ubuntu/Desktop/test.sh -f /home/u/Desktop/ -p 'TEST'
  </code></pre>
  
  <p>I think i'm calling the script correctly, and it should search for the term I enter as a search term using grap. but for some reason it doesn't. Any advice on what I can do as a general rule when working with grep would also be appreciated, thanks.</p>
  
  <pre><code>#!/bin/bash
  
  valid=0
  file_arg=""
  display_help=""
  column=""
  pattern=""
  
  while getopts f:d:s:m: opt
  do
      case "$opt" in
          d)  display_help=$OPTARG
              ;;
          f)  file_arg=$OPTARG
              ;;
          c)  column=$OPTARG
              ;;
          p)  pattern=$OPTARG
              ;;
          *)  valid=1
              break
              ;;
      esac
  done
  
  if [ $valid -eq "0" ]
  then
      if [ $pattern != "" ]
      then
          cat $file_arg | grep $pattern
      else
          cat $file
      fi
  else
      echo -n "Usage: FILE -f &lt;name&gt; | COLUMN -&gt; -c &lt;name&gt; | HELP -&gt; -d | PATTERN -&gt; -p &lt;expression&gt;"
  fi
  </code></pre>