Question : Need script help for df command

I need a script that displays the disk drive with the highest percentage used and its name.  Something like this: "Disk /home is 91% full".  I know that I can use /bin/df to get the %Used but I am stuck on how to determine which disk has the highest percentage of use.  I will be using this on a IBM AIX 5.3 machine which for scripts, acts a lot like a Linux machine.

Thanks,
Mark

Answer : Need script help for df command

Well, here is my first try:

#!/bin/ksh
set $(df -v |grep -v ":" | grep -v "Mounted on" | sort -k 5 |tail -1)
echo "DISK" $9 is $5 "full"
exit

The above doesn't take NFS mounted filesystems into account,
but this can easily be changed (remove the ' grep -v ":" ' part)

wmp


Random Solutions  
 
programming4us programming4us