码迷,mamicode.com
首页 >  
搜索关键字:spawn    ( 366个结果
ssh登录脚本
1 #!/usr/bin/expect 2 set timeout 100 3 set passwd "your password" 4 spawn shell 5 expect "key" 6 send "$passwd\n" 7 interact 第一行主要用于指明expect执行路径,由于登录... ...
分类:其他好文   时间:2017-03-09 11:58:58    阅读次数:144
python subprocess模块
subprocess意在替代其他几个老的模块或者函数,比如: os.system、os.spawn、os.popen、commands。 call执行命令,返回状态码 check_call 执行命令,状态码为0返回0,否则抛出异常。 check_output 如果状态码为0,返回执行后结果,如果状态 ...
分类:编程语言   时间:2017-02-07 10:52:24    阅读次数:267
[转]expect实现ssh自动交互
shell脚本实现ssh自动登录远程服务器示例: #!/usr/bin/expect spawn ssh root@192.168.22.194 expect "*password:" send "123\r" expect "*#" interact 原文链接:http://www.xuanhao ...
分类:其他好文   时间:2017-01-20 11:07:10    阅读次数:195
expect脚本免密码
1 #!/usr/bin/expect 2 set timeout 10 3 spawn ssh root@20.0.102.19 4 expect "password:" 5 send "123456\n" 6 interact 1 #!/usr/bin/expect 2 set timeout ... ...
分类:其他好文   时间:2017-01-16 21:22:19    阅读次数:159
linux expect命令使用入门
expect的核心是spawn expect send set spawn:spawn是进入expect环境后才可以执行的expect内部命令,相当于shell中的内置命令,通过它,调用需要执行的命令 expect:捕获提示 send:发送交互值(结尾需要加上\n) set:设置变量 interac ...
分类:系统相关   时间:2017-01-04 22:56:42    阅读次数:299
Child Process
Child Process child_process 这个模块可以生成一个子进程。nodejs提供了好几个API,本质上都是调用child_process.spawn(): 1 const spawn = require('child_process').spawn; 2 const ls = s ...
分类:其他好文   时间:2016-12-24 01:56:13    阅读次数:175
ping前十台主机并建立用户
#!/usr/bin/expect#!/bin/bashforNUMin{1..10}doping-c1-w1172.25.254.$NUM&>/dev/null&&(/mnt/ssh.exp172.25.254.$NUMredhathostname|grep-E"^The|ECDSA|connecting|Warning|password|spawn"-v|sed"s/Permission\denied\,\please\try\again\./172.25.254.$NUMp..
分类:其他好文   时间:2016-12-16 01:52:53    阅读次数:193
远程连接主机,并用文件匹配方式创建用户
#!/usr/bin/expect-fsetip[lindex$argv0]setpasswd[lindex$argv1]setpath[lindex$argv2]setfile[lindex$argv3]setcmd[lindex$argv2]spawnscp$filepasswordusernameroot@${ip}:$pathexpect"password:*"send"${passwd}\r"spawn/usr/bin/sshroot@${ip}expect"password:"send"${pas..
分类:其他好文   时间:2016-12-15 18:24:02    阅读次数:140
git修复push文件
1 环境 2 错误 3 解决 4 参考 环境 错误 TortoiseGit 客户端 push时报 git.exe push --progress "origin" master:master error: cannot spawn sh: No such file or directoryerror ...
分类:其他好文   时间:2016-12-11 03:07:16    阅读次数:378
HOW TO USE MPS ON SINGLE GPU
HOW TO USE MPS ON SINGLE GPU ? No application modifications necessary ? Proxy process between user processes and GPU ? MPS control daemon ? Spawn MPS ...
分类:其他好文   时间:2016-12-05 23:22:09    阅读次数:170
366条   上一页 1 ... 18 19 20 21 22 ... 37 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!