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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SED how can I delete 1st record and keep the rest 1

Status
Not open for further replies.

marrow

Technical User
Jul 20, 2001
425
US
I want to run "iostat -xtc 2 5 and
delete first set of "extended" stats and print 2nd 3rd 4th and 5th set using SED.
 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How about...
Code:
#!/bin/ksh

typeset -i LINES=$(iostat -xtc|wc -l)
iostat -xtc 2 5 | sed "1,${LINES}d"
Not very fancy, but it works.

 
Thank you Sam that works a treat. Thanks FYI PHV i tried iostat -xtc 2 5|sed '/extended/,/id/d' that was no good, took out all the headings! Tried a number of variations which failed, I'm sure there are numerous ways to do this but my SED is rusty and I was hacking out too many lines and headings.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top