![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| change the filename by adding up 1 each time, tricky one | netbanker | Shell Programming and Scripting | 5 | 03-07-2008 04:45 PM |
| Grabing Date from filename and adding to the end of each line in the file. | rkumar28 | Shell Programming and Scripting | 1 | 05-01-2007 08:25 PM |
| adding contents of file | dakid | UNIX for Dummies Questions & Answers | 4 | 10-20-2006 02:24 PM |
| Adding filename into file content | missutoomuch | Shell Programming and Scripting | 1 | 11-11-2005 04:02 PM |
| adding contents of a variable to a command | gammarays | Shell Programming and Scripting | 2 | 02-08-2005 01:39 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to adding the filename into file contents
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 Last edited by missutoomuch; 11-11-2005 at 05:23 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|