并行 expect { "(yes/no)?" { send "yes\n" expect "*assword:" { send "$password\n"} } "*assword:" { send "$password\n" } } ...
分类:
其他好文 时间:
2017-05-04 14:47:47
阅读次数:
152
今天有一个朋友忽然问我在shell中,如何比较浮点数和整数,倒是把我问的一愣,在工作中确实没有遇到这个场景。我们也知道,在shell中数字的计算通常都会转换成整数,比如说1.1和1会被认为是一样的。这么一来,我们就不能直接通过gt或者lt等方式来进行比较。虽然没遇到过,但我们也知道,这个比较肯定也不 ...
分类:
系统相关 时间:
2017-05-04 12:43:39
阅读次数:
191
一、先安装Tcl 1、下载:tcl版本 8.4.19 http://sourceforge.net/projects/tcl/files/Tcl/8.4.19/tcl8.4.19-src.tar.gz/download 2、解压缩源码包 tar xfvz tcl8.4.19-src.tar.gz 3 ...
分类:
系统相关 时间:
2017-05-04 00:12:46
阅读次数:
200
Shell结合Expect自动输入密码示例 ...
分类:
系统相关 时间:
2017-05-01 14:19:04
阅读次数:
229
有时候经常为如何设置一个安全、符合密码复杂度的密码而绞尽脑汁,说实话,这实在是一个体力活而且浪费时间,更重要的是设置密码的时候经常纠结。终于有一天实在忍不住了,于是学习、整理了一下如何使用Linux下命令来随机生成安全、符合密码复杂度的命令。俗话说“工欲善其事必..
分类:
系统相关 时间:
2017-04-28 23:41:27
阅读次数:
419
Program Structure Every week, you can expect to see this content coming up: Siraj's introductory video & One hour coding session Additional lesson(s) ...
分类:
其他好文 时间:
2017-04-27 10:20:09
阅读次数:
339
#!/usr/bin/expect set host "192.168.31.100" set password "lishiming" spawn ssh root@$host expect { "yes/no" { send "yes\r"; exp_continue } "assword:" ... ...
分类:
系统相关 时间:
2017-04-26 23:44:14
阅读次数:
235
小型自动化运维--expect脚本之指定ip,指定文件进行同步操作#vim5.expect#!/usr/bin/expectsetpasswd"wtf"sethost[lindex$argv0]setfile[lindex$argv1]spawnrsync-av$fileroot@$host:$fileexpect{"yes/no"{send"yes\r"}"password:"{send"$passwd\r"}}expecteof对5.expect授予执..
分类:
其他好文 时间:
2017-04-25 15:09:27
阅读次数:
188
小型自动化运维--expect脚本之自动同步expect脚本可以运用于自动化运维多个方面,例如:可以自动到远程机器执行命令,也可以传输文件到远程机器上。脚本如下:#!/usr/bin/expectsetpasswd"wtf"spawnrsync-avroot@192.168.8.103:/tmp/shiyan.txt/tmp/expect{"yes/no"{send"yes\r..
分类:
其他好文 时间:
2017-04-24 22:54:21
阅读次数:
144