View Single Post
  #6   (View Single Post)  
Old 14th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

because AWK is it's own language as well as a program (awk), I'll add to ocicats post by noting the easiest way to get a specific column out of 'df' output with awk.

Code:
df | awk '{ print $1 }'
which will print the first column to standard output, $2 the second column, $3 the third column and so on.


Accessing the column(s) a line at a time is also easy as pie but I'll let you figure that out along with more useful things ;-)
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote