Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'I like it (shorter and simpler)' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
I like it (shorter and simpler)
Authored by: vczilla on May 10, '12 09:32:23AM

I tried your shorter version and indeed it works here too. I think the key to this story was to have just one list, the one generated by 'df -l'.

Since you asked me (and I know that doesn't really matter anymore),
here is the output of 'df -k | awk -F/ '/disk*/ {print $3}' on my machine:

% df -hlg | awk -F/ '/disk*/ {print $5}'


and 'df -k | awk -F/ '/disk*/ {print $3}':

 df -k | awk -F/ '/disk*/ {print $3}'
disk0s2                   79203656  51490116  27457540    66%    
disk2s2                  365784156 332114676  33669480    91%    
disk1s1                   66559996  65618364    941632    99%    
disk1s2                   36141052  35825216    315836   100%    
disk1s3                   53588152  48312940   5275212    91%    
disk3s1                  256702603 251655316   5047286    99%    
disk3s2                  306239060 303196908   3042152   100%    
disk3s3                   35929372  34222232   1707140    96%   

That's why it didn't work here.

As a side note, there's a slight typo in the awk script regex, which should be /disk.*/ and not /disk*/ (luckily it doesn't change anything for the intended purpose).

I'm glad you didn't take it the wrong way and that you came up with a really short solution, and I hope I didn't came off as being too pedantic. ;-)

[ Reply to This | # ]