我有一个例外文件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