Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String charaters in a file 2

Status
Not open for further replies.

unixkid

IS-IT--Management
May 22, 2001
105
US
Hi all,

I have a script that produceds outout that looks like the following...
Media Written
--------
CDE343 orabot-safe-backup
MA3670 orabot-safe-backup
MA3672 orabot-safe-backup
CDE372 orabot-d02
CDE373 orabot-d02

I want to strip the following lines from the top of the file before feeding that file into another script. Just the two top lines "Media Written and "-------" I have tried sed but cant seem to figure out how to combine two commands on the same lines. Any other ideas...

 
your_script | egrep -v '^--|^Media Written' | another_script Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
was able to do it with the following:

myscript|sed '1,2d' |awk '{print $1,$4}'

now I have to figure out how to send print out the $4 line grouping them by common names
 
tail +3 will read a file starting at line 3 !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top