linux - Syntax error: end of file unexpected (expecting "then") -


i making code minecraft server plugin updater new shell scripter don't know alot...
when run code error:

#!/bin/sh export path=$path:. #options plugindownloadlink=http://api.bukget.org/3/plugins/bukkit/$pluginname/latest/download # plugin folder if [ -f $pwd\plugins ]; plug=$pwd\plugins  else plug=$pwd\plug-ins fi  cd $plug  if [ ! -f .\update ]; mkdir update echo making directory "update".. fi  # plugins found     in $( ls );             pluginname=$i     done     cd .\update      wget $plugindownloadlink      # no plugins found     if [ ! -f $plug ];     echo echo echo    no plugin found. echo echo echo echo   plugins can downloaded here: echo   http://dev.bukkit.org/bukkit-plugins fi  # stop  sleep 3s exit 

i error:

syntax error: end of file unexpected (expecting "then") 

so put "then" in place wanted me , ran again:
gave me error now:

syntax error: end of file unexpected 

i wrote on windows 7 notepad++
how can fix this?

i have met same problem. , problem format of file "dos", in linux shell requires "unix", install "dos2unix"

$ sudo apt-get install dos2unix 

or if use emacs, can this:

c-x ret f unix 

good luck :)


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -