小编use*_*805的帖子

语法错误:文件结束意外(期待"然后")

我正在为Minecraft服务器插件更新程序制作此代码我是一个新的shell脚本程序,所以我不知道很多...
当我运行此代码时,我收到一个错误:

#!/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 …
Run Code Online (Sandbox Code Playgroud)

unix linux shell minecraft

8
推荐指数
2
解决办法
3万
查看次数

Linux"丢失"错误

我想写一个.sh但是得到一个错误:
这是一个minecraftserver更新程序(仅供参考)

码:

#!/bin/sh

# Deleting Old Files
if [ -e spigot1.jar]; then
  rm spigot1.jar

fi

# Renaming
if [ -e spigot.jar]; then
  echo Renaming File...
  mv spigot.jar spigot1.jar
  echo Done.
  echo
  else
  echo

fi

# Downloading
echo Downloading File...
wget http://ci.md-5.net/job/Spigot/lastBuild/artifact/Spigot-Server/target/spigot.jar
echo Done.

# Comparing Files
echo
echo Testing if the files are the same... 
if diff -a -w spigot.jar spigot1.jar >/dev/null ; then
  echo Done.
  echo
  echo -----------------------------------
  echo
  echo You already have the newest version!  
  echo
  echo …
Run Code Online (Sandbox Code Playgroud)

unix linux shell syntax-error minecraft

0
推荐指数
1
解决办法
2236
查看次数

标签 统计

linux ×2

minecraft ×2

shell ×2

unix ×2

syntax-error ×1