我有一個例外文件exception.txt
,其中包含昨天發生的所有異常行。如何從我的日誌文件中篩選日誌
例子:
Null pointer exception
Socket exception
Network exception
End of file exception.
我也有過濾文件filter.txt
,其通過過濾這些線路包含了一些例外的關鍵字,如
End of file exception
Null pointer exception
我想創建一個newexception.txt
文件,shell腳本在filter.txt
中提及。 基本上它應該是exception.txt
的副本,忽略來自filter.txt
的行。
什麼是最好的方法來做到這一點?
這不起作用。即使給了filter.txt和exception.txt的完整路徑,我也沒有看到任何輸出 – chandan
@chandan您需要在bash shell中鍵入它,或者如果是腳本,則需要添加'#!/ usr/bin/bash'行。 – yacc
我這樣做,但仍然沒有工作產生任何輸出。 – chandan