我在文件中有以下正則表達式。 BTW,即時通訊在SunOS沒有輸出從grep或fgrep與-f選項不起作用
例如:文件模式包含以下行:
Ora-[0-9]
violated
我有一個文件 「數據文件」,它包含以下內容:
0:/scm/123451/test1.sql:[email protected]:databasedb:no:yes:ORA-1234|key violated
1:/scm/123451/test1.sql:[email protected]:databasedb:no:yes:ORA-|key violated
2:/scm/123451/test1_A.sql:[email protected]:databasedb:no:yes:ORA-|key violated
3:/scm/123451/test1_B.sql:[email protected]:databasedb:yes:yes:Violated
4.giga:key violated unique:giga
5.fifa:ora-error null value found:giga
現在,我想使用命令grep -f或fgrep -f查找與模式文件的正則表達式匹配的行。當patter文件僅包含「Ora- [0-9]」行時,下面的兩個命令不起作用。
grep -if ./pattern ./datafile
frep -if ./pattern ./datafile
我錯過了什麼,模式文件中的模式是否需要固定字符串?
這就是爲什麼即時通訊使用-i選項與fgrep或grep – 2013-05-10 01:48:09