title: Syntax error: end of file unexpected (expecting "then")
body: <p>I am making this code for a minecraft server plugin updater
  I am a new shell scripter so I don't know alot...<br>
  when I run this code I get a error:</p>
  
  <pre><code>#!/bin/sh
  export PATH=$PATH:.
  #Options
  PLUGINDOWNLOADLINK=http://api.bukget.org/3/plugins/bukkit/$PLUGINNAME/latest/download
  # Plugin folder
  if [ -f $PWD\plugins ]; then
  PLUG=$PWD\plugins 
  else
  PLUG=$PWD\plug-ins
  fi
  
  cd $PLUG
  
  if [ ! -f .\update ]; then
  mkdir update
  echo Making Directory "update"..
  fi
  
  # Plugins Found
      for i in $( ls );
      do
          PLUGINNAME=$i
      done
      cd .\update
  
      wget $PLUGINDOWNLOADLINK
  
      # No Plugins Found
      if [ ! -f $PLUG ]; then
      echo
  echo
  echo    No plugin found.
  echo
  echo
  echo
  echo   Plugins can be downloaded here:
  echo   http://dev.bukkit.org/bukkit-plugins
  fi
  
  # stop 
  sleep 3s
  exit
  </code></pre>
  
  <p>I get this error:  </p>
  
  <pre><code>Syntax error: end of file unexpected (expecting "then")
  </code></pre>
  
  <p>so I put "then" in the place it wanted me to and ran it again:<br>
  it gave me this error now:</p>
  
  <pre><code>Syntax error: end of file unexpected
  </code></pre>
  
  <p>I wrote it on windows 7 notepad++<br>
  how can I fix this?</p>