2013年6月26日

php 调用shell实现文件下载功能

摘要: 用php来实现远程文件下载,所以考虑到了用shell结合php来实现 shell脚本如下: #!/usr/bin/expect -f ####set ip address ############## set ip [lindex $argv 0 ] ####set username ################ set username [lindex $argv 1 ] ###... 阅读全文

posted @ 2013-06-26 01:34 一根烟的寂寞 阅读(276) 评论(0) 推荐(0)

【转】linux expect自动登录ssh,ftp

摘要: expect是一种能够按照脚本内容里面设定的方式与交互式程序进行“会话”的程序。根据脚本内容,Expect可以知道程序会提示或反馈什么内容以及 什么是正确的应答。它是一种可以提供“分支和嵌套结构”来引导程序流程的解释型脚本语言。shell功能很强大,但是不能实现有交互功能的多机器之前的操作,例如ssh和ftp.而expect可以帮助我们来实现.二,实例1,ssh实现自动登录,并停在登录服务器上#!/usr/bin/expect -f set ip [lindex $argv 0 ] //接收第一个参数,并设置IP set password [lindex $argv 1 ] //接... 阅读全文

posted @ 2013-06-26 01:26 一根烟的寂寞 阅读(182) 评论(0) 推荐(0)

[转]Linux 远程执行命令 expect

摘要: 本地交互执行: 1. 修改shell #!/usr/bin/expect set USER [lindex $argv 0] set SHELL [lindex $argv 1] set timeout 3 spawn chsh $USER expect "*]:*" { send "$SHELL\r" } expect eof # ./chsh.sh user1 /bin/tcsh 2.... 阅读全文

posted @ 2013-06-26 00:28 一根烟的寂寞 阅读(518) 评论(0) 推荐(0)

导航