title: Pass Multiple Arguments to Bash Script
body: <p>I have a bash script, which I want to call like this:</p>
  
  <pre><code>bash curl.sh http://www.google.co.uk/ -d Directory -a "Moz 123" -r http://localhost/
  </code></pre>
  
  <p>I can collect the first argument (<a href="http://www.google.co.uk/" rel="nofollow">http://www.google.co.uk/</a>), with the following:</p>
  
  <pre><code>url=$1
  while getopts p:d:a:r: opt; do
  case $opt in
      p) proxy=$OPTARG ;;
      d) dir=$OPTARG ;;
      a) ua=$OPTARG ;;
      r) ref=$OPTARG ;;
  esac
  done
  </code></pre>
  
  <p>However, it does not pick up the other -arguments. If I remove '<a href="http://www.google.co.uk/" rel="nofollow">http://www.google.co.uk/</a>' as the first argument, it picks up the -arguments.</p>
  
  <p>Due to logistics, I am not able to set the first argument, e.g. '<a href="http://www.google.co.uk/" rel="nofollow">http://www.google.co.uk/</a>' with -u etc.</p>
  
  <p>How do you get this to work?</p>