1833806 Members
3079 Online
110063 Solutions
New Discussion

bdf output

 
Donald C Nelson
Frequent Advisor

bdf output

I have a bdf out as:

/dev/vg00/lvol5 20480 17700 2775 86% /home
/dev/vg05/lvoldata4
10485760 8440476 1917492 81% /data4

I am trying to awk '{print$5}' which is the percent used so I can incorporate that into a script file but $5 for the lvoldata4 lv is the /data4 field because lvoldata shifts the rest of the bdf to the next line. Does anyone know how I can make the 81% of /data4 come out of a $5 awk print statement?
3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: bdf output

Don,

I'm attaching a script I got from Bill Hassell (I think) called bdfmegs. I believe it will clean up your formatting issues so you can print $5 and besides, it's nicer in megs!!


Pete

Pete
David Child_1
Honored Contributor

Re: bdf output

I don't have access to a Unix box at the moment (eek!), but I think this might work:

bdf | awk '/%/ { print $(NF-1) }'

David
Donald C Nelson
Frequent Advisor

Re: bdf output

Davids bdf script was what I was looking for.