title: Storing bash script argument with multiple values
body: <p>I would like to be able to parse an input to a bash shell script that looks like the following.</p>
  
  <pre><code>myscript.sh --casename obstacle1 --output en --variables v P pResidualTT
  </code></pre>
  
  <p>The best I have so far fails because the last argument has multiple values. The first arguments should only ever have 1 value, but the third could have anything greater than 1. Is there a way to specify that everything after the third argument up to the next set of "--" should be grabbed? I'm going to assume that a user is not constrained to give the arguments in the order that I have shown.</p>
  
  <pre><code>casename=notset
  variables=notset
  output_format=notset
  while [[ $# -gt 1 ]]
  do
      key="$1"
      case $key in
          --casename)
          casename=$2
          shift
          ;;
          --output)
          output_format=$2
          shift
          ;;
          --variables)
          variables="$2"
          shift
          ;;
          *)
          echo configure option \'$1\' not understood!
          echo use ./configure --help to see correct usage!
          exit -1
          break
          ;;
  
      esac
      shift
  done
  
  echo $casename
  echo $output_format
  echo $variables
  </code></pre>