1846235 Members
6637 Online
110255 Solutions
New Discussion

Re: Awk Script

 
SOLVED
Go to solution

Awk Script

Hi,
I have the following out through bdf command :

# 102400000 4151432 97522888 4% /Archivelog

How do I capture the last 3 fields?

Kindy help.

Thanks
5 REPLIES 5
Denver Osborn
Honored Contributor
Solution

Re: Awk Script

bdf |awk '{print $(NF-3),$(NF-2),$NF}'

-denver
Geoff Wild
Honored Contributor

Re: Awk Script

bdf | awk '{print $3, $4, $5}'

Remember though - bdf wraps if line is too long....

You are better off using df -k instead.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: Awk Script

Have a look at this post - and grab Bill's bdfmegs script.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1064880

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.

Re: Awk Script

Thanks for your kind assistance.
rmueller58
Valued Contributor

Re: Awk Script

bdf |awk '{print $4, $5, $6}'