![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merging of files with different headers to make combined headers file | marut_ashu | Shell Programming and Scripting | 1 | 08-07-2009 05:10 AM |
| Remove text between headers while leaving headers intact | Trones | Shell Programming and Scripting | 3 | 12-27-2008 08:06 PM |
| headers of the query | bhagya.puccha | High Level Programming | 0 | 09-09-2008 01:55 AM |
| C Headers | biosdos | High Level Programming | 0 | 01-22-2006 02:48 PM |
| kernel-headers rpm | Negm | Red Hat | 2 | 04-05-2005 08:40 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Grep Headers
Hi!
Trying to find string and then put the above Headers of corresponding fist line. After executing a Property command a get this output: SP/CH-CH Span Name Type TG Idle InUse OffHk OnHk Ring -------- ------------------------------ ------ ---- ----- ----- ----- 02/01-24 CARRIERSS7 505 2 22 0 0 0 1-24 12 04/01-24 CARRIERSS7 505 2 22 0 0 0 49-72 12 CH TRGP CIC Bearer BLoc-Rem CH TRGP CIC Bearer BLoc-Rem CH -- ---- ----- -------- -------- -- ---- ----- -------- -------- -- ---- 04 0 76 CARRIERISDN2511Reset H 11 505 83 Reset H 18 505 90 Reset H 05 0 77 CARRIERISDN2511Reset H 12 505 84 Reset H 19 505 91 Reset H 07 505 79 CARRIERISDN2511Reset H 14 505 86 Reset H 21 505 93 Reset H 08/01-24 CARRIERISDN2511 SS7CH TRGP CIC Bearer BLoc-Rem CH TRGP CIC -- ---- ----- -------- -------- -- ---- ----- -------- -------- -- ---- 01 511 97 Idle H M 09 511 105 Reset H 17 511 113 Reset H 02 511 98 Reset H 10 511 106 Reset H 18 511 114 Reset H i excute a grep with in this way to filter: Code:
command | grep CARRIERSS7 02/01-24 CARRIERSS7 505 2 22 0 0 0 1-24 12 04/01-24 CARRIERSS7 505 2 22 0 0 0 49-72 12 then i neet to bring the header above the first output line no matter whats the result. i was thinking to store the output in a variable and then excute a second grep to find the hear and then merge in one file all together like this: SP/CH-CH Span Name Type TG Idle InUse OffHk OnHk Ring -------- ------------------------------ ------ ---- ----- ----- ----- 02/01-24 CARRIERSS7 505 2 22 0 0 0 1-24 12 04/01-24 CARRIERSS7 505 2 22 0 0 0 49-72 12 thanx for all |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|