普通的grep,sed命令支持通配符*,?等,如果你想使用复杂的pattern,就需要对转义符/,比如
$ sed '//(hello/)/p' -n awktest
相应地,sed的-r选项就是为了支持扩展的正则功能
类似的grep有egrep(等价于grep -E)
egrep "(mysql.*ds.xml)|(oracle.*ds.xml)"
普通的grep,sed命令支持通配符*,?等,如果你想使用复杂的pattern,就需要对转义符/,比如
$ sed '//(hello/)/p' -n awktest
相应地,sed的-r选项就是为了支持扩展的正则功能
类似的grep有egrep(等价于grep -E)
egrep "(mysql.*ds.xml)|(oracle.*ds.xml)"