The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
port filtering ujjwalmohan HP-UX 0 11-26-2007 01:18 AM
Filtering Data bobo UNIX for Dummies Questions & Answers 2 09-19-2007 04:06 PM
awk filtering ? varungupta UNIX for Advanced & Expert Users 4 09-17-2007 03:55 AM
Filtering Data Raynon Shell Programming and Scripting 7 09-05-2007 07:38 PM
Need help in string filtering (KSH) rockysfr Shell Programming and Scripting 1 06-28-2007 03:04 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-11-2008
invinzin21 invinzin21 is offline
Registered User
  
 

Join Date: Dec 2007
Location: Philippines, Cebu City
Posts: 75
awk and sed filtering

Goo afternoon Sir'sould like to ask your help reagrding in this scenario using sed and awk.

********************************************************
Host:CDRMSAPPS1
Operating System:Linux 2.6.9-42.ELsmp
Machine Type:UNIX
Host Type:Client
Version:5.1
********************************************************

Universal Settings

Restore retries: 0
Browse timeframe for restores 0 days
Required network interface

********************************************************
Host:CERDB1
Operating System:Linux 2.6.9-22.ELsmp
Machine Type:UNIX
Host Type:Client
Version:5.1
********************************************************
Universal Settings

Restore retries: 0
Browse timeframe for restores 0 days
Required network interface

****************************
this is just a test
******************************

********************************

Hostname: cebudr

********************************************************
Host:ROAM-D
Operating System:Linux 2.6.9-34.ELsmp
Machine Type:UNIX
Host Type:Client
Version:5.1
********************************************************


Desired Output :

********************************************************
Host:CDRMSAPPS1
Operating System:Linux 2.6.9-42.ELsmp
Machine Type:UNIX
Host Type:Client
Version:5.1
********************************************************

********************************************************
Host:CERDB1
Operating System:Linux 2.6.9-22.ELsmp
Machine Type:UNIX
Host Type:Client
Version:5.1
********************************************************

*******************************************************
Host:ROAM-D
Operating System:Linux 2.6.9-34.ELsmp
Machine Type:UNIX
Host Type:Client
Version:5.1
********************************************************
  #2 (permalink)  
Old 01-11-2008
dennis.jacob dennis.jacob is offline Forum Advisor  
dj - the student
  
 

Join Date: Feb 2007
Location: Singapore/Bangalore/Cochin
Posts: 610
Try this:

sed -n '/Host/,/Version/p;' filename | sed 's/Host:/\nHost/g'
  #3 (permalink)  
Old 01-11-2008
invinzin21 invinzin21 is offline
Registered User
  
 

Join Date: Dec 2007
Location: Philippines, Cebu City
Posts: 75
thanks sir
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:18 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0