1、局域网网段内主机是否存活脚本ping.sh#!/bin/bash#pingandtesthostsoflansisalive!foriin{1..254}dohost=10.57.36.$iping-c3$host>&/dev/nullif[$?=0];thenecho"$hostisalive!">>/tmp/hosts.logelseecho"$hostisdown!">>/tmp/hosts.logfidonechmod+xping..
分类:
系统相关 时间:
2016-04-01 16:20:36
阅读次数:
242
今天用到了MySql里的isnull才发现他和MSSQL里的还是有点区别,现在简单总结一下:mysql中isnull,ifnull,nullif的用法如下:isnull(expr) 的用法:如expr 为null,那么isnull() 的返回值为 1,否则返回值为 0。mysql> select i...
分类:
数据库 时间:
2016-01-12 15:25:23
阅读次数:
273
一、脚本功能判断IP是否占用,通过ping命令检测的方法,ping通则认为被占用,并且将结果分别输出到IP_yes.txt和IP_no.txt。二、脚本编写#!/bin/bash#Checkthenetworkisonlineip_num=192.168.1.foriin`seq1254`doping-c2$ip_num$i>/dev/nullif[$?=0];thenecho"echo$ip_num$ii..
分类:
系统相关 时间:
2015-12-28 18:52:35
阅读次数:
201
1 isnull(expr) 的用法:如expr 为null,那么isnull() 的返回值为 1,否则返回值为 0。 2IFNULL(expr1,expr2)的用法:假如expr1 不为 NULL,则 IFNULL() 的返回值为 expr1; 否则其返回值为 expr2。IFNULL()的返回值...
分类:
数据库 时间:
2015-12-11 09:54:41
阅读次数:
220
#!/bin/bashmysqlpasswd=mysql-uroot-p$mysqlpasswd-e"showdatabases;"2>/dev/null>/home/hehe/databases.txtforiin`cat/home/hehe/databases.txt`domysqldump-uroot-p$mysqlpasswd$i>/home/hehe/${i}_`date+%Y-%m-%d-%H-%M`.sql2>/dev/nullif[$?-eq0]thenecho"$ib..
分类:
数据库 时间:
2015-11-01 11:30:39
阅读次数:
184
前言:一下两个脚本,实现对多个地址不连续的ip进行ping测试,两个脚本的功能是一样的,脚本如下:第一个脚本:#!/bin/bashcatiplist|whilereadline#iplist是存放IP的文档,与脚本放在一个路径,格式为每行一个IP地址doping-c2$line>/dev/nullif[$?=0]thenecho"$lineisup!"e..
分类:
其他好文 时间:
2015-10-31 10:15:49
阅读次数:
223
#!/bin/bashfor i in `seq 1 254`do{ping -c2 192.168.1.$i &>/dev/nullif [ $? != 0 ];thenecho "192.168.1.$i is not used"fi}done
分类:
其他好文 时间:
2015-10-30 12:18:22
阅读次数:
135
干oracle 047文章12当问题,经验group by 声明。因此邂逅group by rollup,decode,grouping,nvl,nvl2,nullif,RATIO_TO_REPORT等一下。1. decode 与if...then,case...when...这类流数据语句功能差点...
分类:
数据库 时间:
2015-10-12 21:03:55
阅读次数:
235
转载自:http://blog.sina.com.cn/s/blog_46e9573c01015ik8.htmlOracle中函数以前介绍的字符串处理,日期函数,数学函数,以及转换函数等等,还有一类函数是通用函数。主要有:NVL,NVL2,NULLIF,COALESCE,这几个函数用在各个类型上都可...
分类:
数据库 时间:
2015-09-18 18:11:06
阅读次数:
151
onDestory进行释放Handler时,需要判断nullif(null != mHandler) { mHandler.removeMessages(MSG_CHANGE_TEXT_COLOR); mHandler.removeMessages(MSG_JUMP_TO_SUC...
分类:
编程语言 时间:
2015-09-04 11:03:44
阅读次数:
448