Dear Experts,
Please help to teach me how to add the filename into the file content so that i can get the output below:-
Actually the file name
New output that I want
=====2005-11-12=====
EVENTS-20050912 03:33:37 ALARM: BTSSPAN-277-1 30-18013
EVENTS-20050912 12:10:28 ALARM: BTSSPAN-297-2 30-18013
EVENTS-20050912 20:40:05 ALARM: BTSSPAN-297-1 30-18013
EVENTS-20050912 23:55:27 ALARM: BTSSPAN-277-1 30-18013
=====2005-11-13=====
EVENTS-20050913 04:32:42 ALARM: BTSSPAN-193-1 30-18013
EVENTS-20050913 05:40:53 ALARM: BTSSPAN-526-1 30-18013
EVENTS-20050913 09:32:16 ALARM: BTSSPAN-297-2 30-18013
EVENTS-20050913 22:33:07 ALARM: BTSSPAN-297-1 30-18013
**********************************************************
*My existing script but cannot add file name into the content *
bavsmap1:/data/EVENTS $ for i in EVENTS-20050912 EVENTS-20050913
> do
> echo "=====2005-11-$i====="
> zcat $i.tar.Z|plgrep "30-18013"|time_stamp -i|tail +3|awk '{print $1, $2, $3, $4}'
> done
=====2005-11-12=====
03:33:37 ALARM: BTSSPAN-277-1 30-18013
12:10:28 ALARM: BTSSPAN-297-2 30-18013
20:40:05 ALARM: BTSSPAN-297-1 30-18013
23:55:27 ALARM: BTSSPAN-277-1 30-18013
=====2005-11-13=====
04:32:42 ALARM: BTSSPAN-193-1 30-18013
05:40:53 ALARM: BTSSPAN-526-1 30-18013
09:32:16 ALARM: BTSSPAN-297-2 30-18013
22:33:07 ALARM: BTSSPAN-297-1 30-18013