I try to filter the system log by running the sed command
like:
error
info_a1
info_a2
info_a3
crit
info_b
error
info_c1
info_c2
warn
info_d
error
info_x
error
info_p
info
info_w
error
info_z1
info_z2
I expect to get all the error messages like:
error
info_a1
info_a2
info_a3
error
info_c1
info_c2
error
info_x
error
info_p
error
info_z1
info_z2
i use
sed -n “/error/, /[info|warn|crit|]/p”
but it does not work pretty well.
1 Answer