- 论坛徽章:
- 33
|
回复 20# gxxiaotian
test.sh- CfgDate=20130328102103
- StopTime=20130328102105
- COMMAND_DIR=/tmp/tmp/urfile
- st=urfile
- awk -F "]" -v StartTime=${CfgDate} -v EndTime=${StopTime} -v ComList=${COMMAND_DIR} 'BEGIN{
- }
- {
- if(FILENAME==ComList)
- {
- exist_flag[$0]=1;
- Total[$0]=0
- Fail[$0]=0
- }
- else
- {
- if($3 == "[Result")
- {
- RowTime=substr($1,2)
- if((RowTime<StartTime) || (RowTime >=EndTime))
- {
- print $0
- next
- }
- }
- }
- }END{
-
- }' $COMMAND_DIR $st
复制代码[root@ tmp]# cat urfile
[20130328102101][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102102][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102103][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102104][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102105][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102106][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102107][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102108][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102109][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[root@ tmp]# ./test.sh
[20130328102101][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102102][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102105][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102106][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102107][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102108][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
[20130328102109][4][Result][125][21][iuseradm][internal][2][The command is failed][4][abcdefg][RETN=1003,DESC="FAIL";]
|
|
|