免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: aksmw-ak
打印 上一主题 下一主题

自动ftp小问题,困惑了好久,高手看看 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2007-10-29 09:25 |只看该作者
顺便问问弱智的问题 ftp ftp://用户名ftp服务器 <<!, 后面的<<!表示什么,我看使用数据库也用这样的字符,比如
dbaccess <<!
sql query
!
上面的 <<! 是不是shell调用外部命令,<<! ...... !之间的代码shell都认为是特殊格式非shell程序??

论坛徽章:
0
12 [报告]
发表于 2007-10-29 09:53 |只看该作者
<<!
.....
!
把这个之间的东西作为命令执行的标准输入

论坛徽章:
0
13 [报告]
发表于 2007-10-29 11:26 |只看该作者
原帖由 springwind426 于 2007-10-29 09:53 发表


感谢楼上的,呵呵困惑已久!

比我我现在想查询 ftp 上是否有某一文件存在,想把ls的内容重定向到某处,该如何操作?

论坛徽章:
0
14 [报告]
发表于 2007-10-29 15:54 |只看该作者

论坛徽章:
0
15 [报告]
发表于 2007-10-29 22:25 |只看该作者
我的一个上传脚本:

  1. henry@henrydesktop:~/h/www$ cat autoftp.sh
  2. #!/bin/bash

  3. # This script can transfer specified file up to cyberspace.org.
  4. # usage: autoftp.sh filename destination
  5. # It upload the file 'filename' to ~/destination/ directory in
  6. # the cyberspace.org with the user TAW and password.
  7. # Auther: Henry
  8. # Date  : 10/1/2007

  9. if [ $# -ne 2 ]
  10. then
  11.         echo "usage: autoftp.sh filename destination"
  12.         exit 1
  13. fi

  14. # Beginning of ftp script commands
  15. ftp -niv cyberspace.org << limitstring
  16. user TAW password
  17. cd $2
  18. ascii
  19. put $1
  20. bye
  21. limitstring
  22. # End of ftp script commands

  23. echo "End"
复制代码

[ 本帖最后由 TAW 于 2007-10-29 22:30 编辑 ]

论坛徽章:
0
16 [报告]
发表于 2007-10-30 22:58 |只看该作者
看样子.真没好办法了.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP