摘要: 1、方括号表达式在方括号表达式中,所有其他的mete字符(即元字符,特殊字符)都会失去其特殊含义。 eg:[*\.]匹配于字面上的星号、反斜杠和句点。 另外,要让 ] 进入该集合,可以将它防盗列表的最前面。1 >cat tmp 2 ab]cdef3 acdg4 cd5 a-g6 >grep []] tmp 7 ab]cdef如果有减号字符进入该集合,也应该放到最前端,如果两者都有 ,则将右方括号放到第一个字符,减号放到最后一个字符。2、后向引用BRE(在ERE中并不存在)提供了一种叫后向引用的机制(backreferences),意思是“匹配于正则表达式匹配的先前部分”。一共需要两 阅读全文
posted @ 2012-01-04 21:41 leealways87 阅读(210) 评论(0) 推荐(0) 编辑
摘要: #include <signal.h>#include <unistd.h>#include <stdio.h>#include "apue.h"static volatile sig_atomic_t sigflag;static sigset_t newmask, oldmask, zeromask;static voidsig_usr(int signo){ sigflag = 1;}voidTELL_WAIT(void){ if(signal(SIGUSR1, sig_usr) == SIG_ERR) err_sys(" 阅读全文
posted @ 2012-01-04 13:24 leealways87 阅读(659) 评论(0) 推荐(0) 编辑
摘要: Title: Implementing Software TimersBy: Don LibesOriginally appeared in the Nov. 1990 “C User’s Journal” and is alsoreprinted as Chapter 35 of “Obfuscated C and Other Mysteries”,John Wiley & Sons, 1993, ISBN 0-471-57805-3.http://www.wiley.com/compbooks/m3.html.——————————————————————— This column 阅读全文
posted @ 2012-01-04 10:41 leealways87 阅读(373) 评论(0) 推荐(0) 编辑