title: Problems running BASH script from a different directory (directory is in path)
body: <p>To start learning BASH scripting, I've created a trivial script that curls down a stock price from YAHOO and prints it to STDOUT. I've set the permissions to rwx for everyone, and moved the file into my path:</p>
  
  <p>Script:</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ cat quote
  #!/bin/bash
  
  while getopts "s:" opt; do
      case $opt in
          s)STOCK="$OPTARG";;
          \?) echo "ERROR"; exit 1;;
      esac
  done
  
  PRICE=$(curl -s "http://download.finance.yahoo.com/d/quotes.csv?s=${STOCK}&amp;f=l1")
  echo "${STOCK}: ${PRICE}"; exit 0
  
  exit 0
  </code></pre>
  
  <p>I then set the permissions for all users:</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ chmod 777 quote
  </code></pre>
  
  <p>Here is my $PATH:</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ echo $PATH
  /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  </code></pre>
  
  <p>I now move it into my path in what I read was the appropriate location for custom user scripts:</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ ls -la /usr/local/bin
  total 12K
  drwxrwsr-x  2 root staff 4.0K Apr 30 01:28 ./
  drwxrwsr-x 10 root staff 4.0K Jan  1  1970 ../
  -rwxrwxrwx  1 root root   433 Apr 30 01:22 quote*
  </code></pre>
  
  <p>The which command will find it (expected):</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ which quote
  /usr/local/bin/quote
  </code></pre>
  
  <p>PROBLEM: when I run the script, it returns the first option on the next line followed by my prompt:</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ quote -s aapl
  '-s'root@raspberrypi:~/code/scripts$
  </code></pre>
  
  <p>But, when I run the script with a full path, it works just fine:</p>
  
  <pre><code>root@raspberrypi:~/code/scripts$ /usr/local/bin/quote -s aapl
  -s: 592.33
  </code></pre>
  
  <p>Apologies if this less a programming question and more a Unix question, but I want to make sure I rule out a problem with my code before I do anything else.</p>
  
  <p>I'm sure this is something very easy, so thanks in advance for the extra set of eyes.</p>