码迷,mamicode.com
首页 >  
搜索关键字:spawn    ( 366个结果
python expect交互
[root@pc0003glpi_switch_ocs]#catssh3.py #!/usr/bin/envpython #-*-coding:utf-8-*- importpexpect importgetpass,os defssh_command(user,host,password,command): ssh_newkey=‘Areyousureyouwanttocontinueconnecting‘ child=pexpect.spawn(‘ssh-l%s%s%s‘%(user,host,com..
分类:编程语言   时间:2015-11-23 19:27:02    阅读次数:229
验证两台机器已经建立的ssh互信
1.expect方法#!/bin/bashcheckTrust(){ expect -c ' set timeout 2; spawn ssh $1 "expr 12345678 + 87654321" expect { ...
分类:其他好文   时间:2015-11-12 11:42:17    阅读次数:323
expect用法
#!/bin/bash echo?"=====?build?and?upload?Linux?server?=====" gox?-osarch??"linux/amd64" echo?"=====?build?finish?=====" /usr/bin/expect?<<-EOF set?timeout?120 spawn?scp?xxx_linux...
分类:其他好文   时间:2015-11-04 15:01:32    阅读次数:211
【转】使用expect实现shell自动交互
原文地址:http://www.nginx.cn/1934.htmlshell脚本需要交互的地方可以使用here文档是实现,但是有些命令却需要用户手动去就交互如passwd、scp对自动部署免去用户交互很痛苦,expect能很好的解决这类问题。expect的核心是spawn expect send ...
分类:系统相关   时间:2015-10-28 20:51:03    阅读次数:276
Linux--使用expect进行自动交互
在linux下进行一些操作时,有时需要与机器进行一些交互操作,比如切换账号时输入账号密码,传输文件时输入账号密码登陆远程机器等,但有时候这些动作需要在shell脚本中进行,这个时候就可以使用expect来进行自动的交互操作,从而避免需要人工干预引起的脚本中断执行。expect的核心命令:spawn ...
分类:系统相关   时间:2015-10-09 13:31:50    阅读次数:177
cocos常用的action API
下面,我们先简单的介绍一下几个常用的action的API。cc.repeatForever(action) 无限循环某个actioncc.sequence(action1,action2,...)顺序执行括号里面的actioncc.spawn(action1,action2,...)同时执行括号里面...
分类:Windows程序   时间:2015-09-30 18:09:14    阅读次数:321
同步文件至多个机器脚本(免输密码)
转载请标明出处~#!/bin/bashSPATH=/tmp/index.js #测试路径/文件DPATH=/tmp/index.js_bak #目标路径/文件distribute_rsync () { ###分发函数expect -c " spawn rsync -aP $...
分类:其他好文   时间:2015-09-23 23:30:50    阅读次数:503
nginx+fastcgi+c/cpp
参考:http://github.tiankonguse.com/blog/2015/01/19/cgi-nginx-three/跟着做了一遍,然后根据记忆写的,不清楚有没错漏步骤,希望多多评论多多交流。。。搭建环境安装:nginx、spawn-fcgi、fastcgi、fcgiwrapnginxs...
分类:其他好文   时间:2015-09-23 21:05:50    阅读次数:233
python pexpect 启动、与子进程交互的例子--logstash
import pexpect,syschild = pexpect.spawn('/home/cf/elk/Summoner/Elk/logstash/test/bin/logstash -f /home/cf/elk/Summoner/Elk/logstash/test/conf.d', time...
分类:编程语言   时间:2015-09-16 17:55:06    阅读次数:237
系统批量运维管理工具pexpect
1、介绍pexpect通过pexpect我们可以实现对ssh,ftp,passwd,telnet等命令进行自动交互,不需要人工干预达到自动目的。2、pexpect的组件介绍2.1、spawn类作用:启动和控制子应用程序,其构造函数如下:classpexpect.spawn(command,args=[],timeout=30,maxread=2000,searchwindowsi..
分类:其他好文   时间:2015-09-13 20:06:03    阅读次数:315
366条   上一页 1 ... 24 25 26 27 28 ... 37 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!