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 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-25-2007 10:18 PM
Filtering Data bobo UNIX for Dummies Questions & Answers 2 09-19-2007 12:06 PM
awk filtering ? varungupta UNIX for Advanced & Expert Users 4 09-16-2007 11:55 PM
Filtering Data Raynon Shell Programming and Scripting 7 09-05-2007 03:38 PM
Need help in string filtering (KSH) rockysfr Shell Programming and Scripting 1 06-27-2007 11:04 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-10-2008
Registered User
 

Join Date: Dec 2007
Location: Philippines, Cebu City
Posts: 67
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
********************************************************
Reply With Quote
Forum Sponsor
  #2  
Old 01-10-2008
dj -------
 

Join Date: Feb 2007
Location: Cochin/Bangalore, India
Posts: 435
Try this:

sed -n '/Host/,/Version/p;' filename | sed 's/Host:/\nHost/g'
Reply With Quote
  #3  
Old 01-11-2008
Registered User
 

Join Date: Dec 2007
Location: Philippines, Cebu City
Posts: 67
thanks sir
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0