posts - 297,  comments - 15,  trackbacks - 0
#!/bin/sh                       
#date=20080916                  
#echo $date                     
ftp -i -n 192.168.1.161 <<EOF  
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 <<EOF                                         
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 阅读(1189) 评论(0)  编辑 收藏 引用 所属分类: Shell

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2009年11月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

常用链接

留言簿(10)

随笔分类(307)

随笔档案(297)

algorithm

Books_Free_Online

C++

database

Linux

Linux shell

linux socket

misce

  • cloudward
  • 感觉这个博客还是不错,虽然做的东西和我不大相关,觉得看看还是有好处的

network

OSS

  • Google Android
  • Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
  • os161 file list

overall

搜索

  •  

最新评论

阅读排行榜

评论排行榜