Problem is :- in .dat file there is N number of records. for Ex. ******Record Number [837]*******ugdRec1.ban : 0ugdRec1.bill_seq_no : 0ugdRec1.subscriber_no : ugdRec1.channel_seizure_dt : 110618090132ugdRec1.message_switch_id : 5402 ugdRec1.resource_no : ******Record Number [63]*******ugdRec1.ban : 0ugdRec1.bill_seq_no : 0ugdRec1.subscriber_no : ugdRec1.channel_seizure_dt : 20110618064544ugdRec1.message_switch_id : 5020 ugdRec1.resource_no :
I want to seach a string "[XXXX]" and print 7 line from string in log and check if ugdRec1.resource_no is null or not. if null send me a mail with Record number from file. I tried using sed but not any luck... Note :- XXXX is vary. its digiti.e Record number.May be 2 digit or may be 5 digit.
hi itkamaraj,
I tried, but its not working.
$ grep -A 7 64 temp
grep: illegal option -- A what i want, If "ugdRec1.resource_no" is null mean (colon( : ) and no number is present .i.e empty) then return that particular record.