[CODE] /**************************** * * filename:errno_const.c * * date: 2007-07-13 * * test all values of error * ***************************/ #includestdio.h> /* perror() */ #includestring.h> /* strerror() */ #includeerrno.h> /* errno */ int main() { fprintf(stderr,"EACCES:%s\n",strerror(EACCES)); fprintf(stderr,"ENOENT:%s\n",strerror(ENOENT)); fprintf(stderr,"E...
#!/bin/bash #reset iptables to default values iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables -t nat -P PREROUTING ACCEPT iptables -t nat -P POSTROUTING ACCEPT iptables -t nat -P OUTPUT ACCEPT iptables -F iptables -t nat -F iptables -X iptables -t nat -X 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/56374/showart_2034570.html
#!/bin/sh # # rc.flush-iptables - Resets iptables to default values. # # Copyright (C) 2001 Oskar Andreasson # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT AN...
这几天在看智能操作符相关操作(~~),对keys的遍历可以用: %hash ~~ /PATH/; 这个系统默认会对hash的键值进行遍历,省去了用foreach循环的麻烦,但是想到如何遍历values呢?用上面的方法?
本帖最后由 a.a 于 2013-08-28 15:49 编辑 一般会使用mysqldump进行导出备份,很想知道在默认的情况一个导出文件里面一个insert () 后面有多少个values(),然后再写下一条insert() 有知道的朋友,指点下,谢谢。
%some_hash = ( "a", 1, "b", 2,"c", 3, "a",4 ); print $some_hash{"a"}; 这样打印出来的是"a"最后一个values:4,如果要打印出5,也就是"a"的两个值相加,有什么简单点的写法吗?谢谢。
my @values = split /\s+/, $_; next unless scalar @values == 14; print "run4 $values[1] \n" if($values[1] =~ /[^\d\.]/); if($values[1] =~ /[^\d\.]/);这个正则表达式怎么理解? 怎么会匹配: Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util 这行?