亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: awk 和 grep -E (RHEL 5.4 ) 匹配結(jié)果為什么不一樣 [打印本頁(yè)]

作者: jils2013    時(shí)間: 2012-04-26 14:39
標(biāo)題: awk 和 grep -E (RHEL 5.4 ) 匹配結(jié)果為什么不一樣
  1. [root@localhost ~]# awk --version
  2. GNU Awk 3.1.5
  3. ......
  4. [root@localhost ~]# grep -E "(.+=.+,){1,}" map
  5. WebSphere:cell=localhostNode01Cell,node=localhostNode01,server=server1
  6. [root@localhost ~]# awk '$0~/(.+=.+,){1,}/' map
  7. [root@localhost ~]# cat map
  8. ......
  9. WebSphere:cell=localhostNode01Cell,node=localhostNode01,server=server1
  10. ......
復(fù)制代碼
同樣的表達(dá)式為什么結(jié)果不一樣呢

作者: jils2013    時(shí)間: 2012-04-26 14:42
是平臺(tái)的問(wèn)題嗎,印象中以前用的系統(tǒng)沒(méi)這樣的
作者: jils2013    時(shí)間: 2012-04-26 14:51
大家的機(jī)器上沒(méi)這種問(wèn)題嗎?
作者: jils2013    時(shí)間: 2012-04-26 15:06
本帖最后由 jils2013 于 2012-04-26 15:07 編輯

結(jié)貼,太蛋疼了,rhel  上居然需要加 --posix 或者 --re-interval

下面是man里的描述

       r{n}
       r{n,}
       r{n,m}     One  or  two  numbers inside braces denote an interval expression.  If there is one number in the
                      braces, the preceding regular expression r is repeated n times.  If there are two  numbers  sepa-
                      rated by a comma, r is repeated n to m times.  If there is one number followed by a comma, then r
                      is repeated at least n times.
                      Interval expressions are only available if either --posix or --re-interval is  specified  on  the
                      command line.

作者: zooyo    時(shí)間: 2012-04-26 15:17
提示: 作者被禁止或刪除 內(nèi)容自動(dòng)屏蔽
作者: ulovko    時(shí)間: 2012-04-26 15:36
zooyo 發(fā)表于 2012-04-26 15:17
因?yàn)閍wk不認(rèn)識(shí){n,m}這樣的正則表達(dá)式.


原來(lái)是這樣!




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2