码迷,mamicode.com
首页 >  
搜索关键字:expect shell    ( 29247个结果)
windows下Python shell代码自动补全
Unix下实现如题功能用下面的代码:import rlcompleter, readlinereadline.parse_and_bind('tab: complete')但readline不能在win中用,需要为windows编译好的pyreadlinepip install pyreadline...
分类:编程语言   时间:2014-08-05 13:41:09    阅读次数:439
windows创建桌面快捷方式的VBA脚本
Dim wShell, oShortcut 'Dim strDesktop$ ' 为了与VBS兼容, Dim strDesktop ' 这里改写一下,测试通过。。。 Set wShell = CreateObject("Wscript.shell") strDesktop = wShell.Spe....
分类:Windows程序   时间:2014-08-05 13:34:19    阅读次数:348
批量登陆linux主机脚本
#test.sh #!/bin/bash dir=/home/test whilereadline do host=`echo$line|awk‘{print$1}‘` passwd=`echo$line|awk‘{print$2}‘` $dir/expect_ssh.sh$host$passwd& done<$dir/host.txt #expect_ssh.sh #!/usr/bin/envexpect setHOST[lindex$argv0] setPASSWD[lindex$argv..
分类:系统相关   时间:2014-08-05 11:33:10    阅读次数:243
使用jq工具在Shell命令行处理JSON数据
因为最近要处理一些 JSON 数据格式,所以在经过一番搜索后 最终找到了 jq 这个很棒的工具。jq 允许你直接在命令行下对 JSON 进行操作,包括分片、过滤、转换等等。 让我们通过几个例子来说明 jq 的功能: 一、输出格式化,漂亮的打印效果 如果我们用文本编辑器打开 JSON,有时候可能看起来会一团糟,但是通过 jq 的 .(点)过滤器就可以立马让 JSON 的格式规整起来。 1.用...
分类:Web程序   时间:2014-08-05 09:40:29    阅读次数:247
linux备份和mysql登陆自动输入密码
1.mysql自动登陆,系统自己输入密码(1)安装亿需要的软件[root@db2~]#yuminstallexpect-*(2)在脚本中写入命令#!/usr/bin/expect-f--使用expect软件settimeout2--输出密码时延时2秒spawnmysql-uroot-p--mysql登陆命令expect"system"--mysql的密码send"system\n"--mysql的密码inte..
分类:数据库   时间:2014-08-05 03:15:19    阅读次数:265
详细理解“>/dev/null 2>&1”
Linux系统中无论是crontab里面,还是平时使用的命令,经常会碰到">/dev/null 2>&1"。比如说:在Crontab Job里面,如果不想发送邮件,那么有两种方法: 一是将MAILTO="", 设置为空 [root@host etc]# cat crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO="" HOME=/ # run-parts 01 * * * * root run-parts /etc/cron...
分类:其他好文   时间:2014-08-05 00:47:48    阅读次数:344
SSH Secure Shell Client--- the host may be dow
the host may be down,or there may be a problem with the network connection.Sometimes such problems can also be caused by a misconfigured firewall.遇到这样...
分类:其他好文   时间:2014-08-05 00:19:28    阅读次数:454
Linux Shell 编程实战技巧
目前,越来越多的企业应用会部署在Linux系统上的,而LinuxShell脚本可以极大地帮助我们完成这些应用的运维任务。这使得LinuxShell开发技能成为开发人员的一项重要的、有竞争力的技能。本文就笔者的实际开发经验,以KornShell为例分享了脚本开发中的常见问题及相关技巧。避免定..
分类:系统相关   时间:2014-08-04 18:18:48    阅读次数:388
XShell技巧
复制和粘贴复制:Ctrl+Insert粘贴:Shift+Insert另外还可以设置点鼠标右键就是粘贴,设置选项在:Tools/Options/general的Right-button;将当前Shell中的内容复制到"记事本"中XShell中内置了这一功能,选中内容,鼠标右键,选择"ToNotepad",再选中"SelectArea"或者"All"或者"S..
分类:其他好文   时间:2014-08-04 18:10:28    阅读次数:366
控制namenode检查点发生的频率
1、关闭集群 2、通过修改core-site.xml ??<property> ????<name>fs.checkpoint.period</name> ????<value>180</value><!--单位为秒--> ??</property> ??<property> ????<name>fs.checkpoint.d...
分类:其他好文   时间:2014-08-04 14:48:57    阅读次数:202
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!