title: Having trouble with simple Bash if/elif/else statement
body: <p>I'm writing bash scripts that need to work both on Linux and on Mac.</p>
  
  <p>I'm writing a function that will return a directory path depending on which environment I'm in.</p>
  
  <p>Here is the pseudo code:</p>
  
  <p>If I'm on a Mac OS X machine, I need my function to return the path:</p>
  
  <pre><code>/usr/local/share/
  </code></pre>
  
  <p>Else if I'm on a Linux machine, I need my function to return the path:</p>
  
  <pre><code>/home/share/
  </code></pre>
  
  <p>Else, you are neither on a Linux or a Mac...sorry.</p>
  
  <p>I'm very new to Bash, so I apologize in advance for the really simple question.  </p>
  
  <p>Below is the function I have written.  Whether I'm on a Mac or Linux, it always returns </p>
  
  <p><code>/usr/local/share/</code> </p>
  
  <p>Please take a look and enlighten me with the subtleties of Bash.</p>
  
  <pre><code>function get_path(){
      os_type=`uname`
      if  [ $os_type=="Darwin" ]; then
              path="/usr/local/share/"
      elif [ $os_type=="Linux" ]; then
              path="/home/share/"
      else
              echo "${os_type} is not supported"
              exit 1
      fi 
      echo $path
  </code></pre>
  
  <p>}</p>