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

skip firt line

Status
Not open for further replies.

TheDash

MIS
Mar 25, 2004
171
US
Hi,
Can we skip first line during processing? for example: the first line shows header info.

Ex: bdf -i | awk {'print $5'} gives %used where as it should start with next line so that it will give 11% ...

Thanks
 
bdf -i | awk 'NF > 1 {print $5}'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
ooops, sorry:

bdf -i | awk 'FNR > 1 {print $5}'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks all for the immediate help.

I also need to trim down 11% to 11? Can somebody please tell how I can substring $var? Unfortunately, I don't see substr help anywhere.
 
Have you tried this ?
bdf -i | awk 'FNR > 1 {sub(/%/,"",$5);print $5}'

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
bdf -i | awk 'FNR > 1 {print $5+0}'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top