title: Bash Shell - Reading option with multiple letters
body: <p>I am working on a shell script that allows users to set options.
  The script is working fine if the user specifies options seperately. For instance:</p>
  
  <pre><code>./my_file.sh -r -l directory1 directory2
  </code></pre>
  
  <p>The command above is working perfectly, however my script doesn't work if the user specifies the following command:</p>
  
  <p>EDIT: What I mean is that the <code>-l</code> option is not recognized if the user enters the command below</p>
  
  <pre><code>./my_file.sh -rl directory1 directory2
  </code></pre>
  
  <p>This is the code I am using to read the options</p>
  
  <pre><code>while getopts 'lvibrd:v' flag; do
    case "${flag}" in
      l) option_l=true
         shift ;;
      v) option_v=true 
         shift ;;
      i) option_i=true
         shift ;;
      b) option_b=true
         shift ;;
      r) option_r=true
         shift ;;
      d) option_d=true
         shift ;;
      *) echo "Invalid options ${flag}" 
         exit 1 ;;
    esac
  done
  </code></pre>
  
  <p>Is there a way to read options with multiple letters, such as <code>-rl</code>, using similar code?
  Thank you in advance.</p>