![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 ******************************************************** |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Try this:
sed -n '/Host/,/Version/p;' filename | sed 's/Host:/\nHost/g' |
|
#3
|
|||
|
|||
|
thanks sir
|
|||
| Google The UNIX and Linux Forums |