- 论坛徽章:
- 3
|
文件alert_DW.log内容vi后如下
Sun Sep 18 10:22:15 2016
Sat Sep 17 10:07:46 2016
DBMS_STATS: GATHER_STATS_JOB
Errors in file
ORA-=10000: Unable to set values10000
Sat Sep 17 10:29:41 2016
ttt
fff
ddf
Errors in file
ORA-20001: Unable to set values20001
ddd
fff
ttt
mmm
nnn
fff
:set nu则显示如下
1 Sun Sep 18 10:22:15 2016
2 Sat Sep 17 10:07:46 2016
3 DBMS_STATS: GATHER_STATS_JOB
4 Errors in file
5 ORA-=10000: Unable to set values10000
6 Sat Sep 17 10:29:41 2016
7 ttt
8 fff
9 ddf
10 Errors in file
11 ORA-20001: Unable to set values20001
12 ddd
13 fff
14 ttt
15 mmm
16 nnn
17 fff
18
执行命令sed -n "7,20 p" alert_DW.log|grep -nA3 -nB2 'ORA-'
显示如下
3-ddf
4-Errors in file
5:ORA-20001: Unable to set values20001
6-ddd
7-fff
8-ttt
第一个问题:上面命令的如何把显示结果3-、4-、5:、6-、7-、8-剔除,显示为如下
ddf
Errors in file
ORA-20001: Unable to set values20001
ddd
fff
ttt
第二个问题,如何按:set nu显示真实行数,显示为如下
9 ddf
10 Errors in file
11 ORA-20001: Unable to set values20001
12 ddd
13 fff
14 ttt
|
|