提示语法错误,哪位帮改改

sh/bash/dash/ksh/zsh等Shell脚本
回复
liucheng1513
帖子: 62
注册时间: 2010-09-08 18:17
送出感谢: 0
接收感谢: 0

提示语法错误,哪位帮改改

#1

帖子 liucheng1513 » 2011-03-18 9:42

#! /bin/bash
rm -rf /tmp/media_version.tmp
cd /tmp
lftp << EOF
open ftp://admin:12345678@192.168.1.2
get -c /media-fuzhu/media_version.txt
EOF
mv /tmp/media_version.txt /tmp/media_version.tmp
version=`awk -F= '{ print $1 }' /tmp/media_version.tmp`
media_version=`awk -F= '{ print $1 }' /home/data/media-fuzhu/media_version.txt`
if [[ "$version" -gt "$media_version" ]];then
{
lftp << EOF
open ftp://admin:12345678@192.168.1.2
mirror --continue /media-link/ /home/data/
mirror --continue /media-fuzhu/ /home/data/
EOF
mv /tmp/media_version.tmp /home/data/media-fuzhu/media_version.txt
}
fi

if [[ "$version" = "$media_version" ]];then
{
echo "下载成功"
}
else
{
lftp << EOF
open ftp://admin:12345678@192.168.1.2
mirror --continue /media-link/ /home/data/
mirror --continue /media-fuzhu/ /home/data/
EOF
mv /tmp/media_version.tmp /home/data/media-fuzhu/media_version.txt

}
fi


提示语法错误,哪位帮改改,")syntax error: operand expected (error token is "
回复

回到 “Shell脚本”