一:使用for循环测试局域网内(192.168.1.0/24)服务器的网络状态 #!/bin/bash for i in {1..254} do if ping -c 1 192.168.1.$i &>/dev/null then echo 192.168.1.$i is UP. else echo 192.168.1.$i is DOWN. fi done 二:删除本目录下的所有空的txt文件,并打印出删除文件的总数 #!/bin/bash n=0 for i in $(find . -type f -name "*.txt") do if [ ! -s $i ] then ...
print 语句会给每一行添加一个换行符,只要在print语句后面添加1个","就会把结果打出在一行。实用的函数dir([obj]) 显示对象的属性,如果没有提供参数,显示全局变量的名字。help([obj]) 以一种整齐美观的形式,显示对象的文档字符串,如果没有提供任何参数,则会进入交互式帮助。int(obj) 将一个对象转化为整型。len(obj) 返回对象的长度。open(fn, mode) 以mode方式打开一个文件名为fn的文件。range([start,]stop[,step])...
Server Monitor http://www.nagios.org 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/3253/showart_193733.html
- Signals are delivered to process wide instead of thread wide, a process group (may include many threads) only have a single signal handler (sigaction), but each thread may have their own signal mask - A thread's signal mask is inherited from it's creator. - A thread could alter its signal mask by calling pthread_sigmask(), even though sigprocmask() is almost indentical under Linux, but we should...