Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1614321
  • 博文数量: 409
  • 博客积分: 6240
  • 博客等级: 准将
  • 技术积分: 4908
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-01 00:04
文章分类

全部博文(409)

文章存档

2021年(1)

2019年(1)

2017年(1)

2016年(13)

2015年(22)

2013年(4)

2012年(240)

2011年(127)

分类: LINUX

2015-03-30 20:23:20



  1. [root@yang testshell]# cat ftptest.sh
  2. #bin/bash
  3. host=localhost;
  4. username=ykftp;
  5. password=yk123;
  6. ddir=/file1/file2/
  7. #ftp -i -v -n ${host}<<ok
  8. ftptestfile(){
  9. ftp -i -n ${host}<<ok
  10. use ${username} ${password}
  11. binary
  12. ls ${ddri}
  13. bye
  14. ok
  15. }
  16. #ftptestfile;
  17. ftptestfile >>/home/testshell/shuchu.txt 2>&1
  18. awk '/^-/{print $0}' /home/testshell/shuchu.txt
  19. exit 0;
  20. [root@yang testshell]# bash ftptest.sh
  21. -rw-r--r-- 1 501 50 1655 Mar 28 11:46 hi.gif
  22. -rw-r--r-- 1 501 50 1285396902 Apr 01 09:43 linux_11gR2_database_1of2.zip
  23. -rw-r--r-- 1 501 50 995359177 Apr 01 09:52 linux_11gR2_database_2of2.zip
  24. -rw-r--r-- 1 501 50 95570 Jul 03 11:27 01304-05-.xlsx
  25. [root@yang testshell]#
  26. [root@yang testshell]#
这里面输出的文件,可以查看是否有自己要判断的文件


阅读(3983) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~