#!/bin/sh
#date=20080916
#echo $date
ftp -i -n 192.168.1.161 <
user name password
cd bj
ls *20080916* 20080916
bye
EOF
aaaa=`ls *20080916* |wc -l`
echo $aaaa
bbbb=`cat 20080916|wc -l`
echo $bbbb
if [ $aaaa -eq $bbbb ]
then
echo "ftp transfered completely "
else
echo "ftp transfered error"
fi
#!/bin/sh
ftp -i -n 192.168.1.152 <
user name password
ls -lt file1
bye
EOF
ls -lt >file2
awk '{print $5}'file2 | while read tty
do\
awk 'BEGIN {...}END{name="'tty'";\
if($5==$name)\
printf("%s",zhengque);\
else\
printf("%s transfer error\n",$9);\
printf("the size of source file is %d,the size of this file after ftp\
transferred is %d",$name,$5);\
}\
' file1\
done\
转自:
http://blog.chinaunix.net/u/28584/showart.php?id=1211619
posted on 2009-11-23 21:23 chatler 阅读(927) 评论(0) 编辑 收藏 引用 所属分类: Shell