Kood: |
get_freespace()
##############
PRE : $1 is the name of the directory to check for disk space.
POST: echos free disk space used by parent of $1
OVERWRITES: JUNK
{
if [ "_$1" = "_" ]; then
echo "0"
fi
JUNK="`get_parent "$1"`"
case "$OS_NAME" in
SunOS )
$DF -bk "$JUNK" |sed 1d |tr -s ' ' | cut -d" " -f,4
;;
Darwin )
$DF -k "$JUNK" | tail -1 | tr -s ' ' | cut -d" " -f 4
;;
Linux )
$DF -kP "$JUNK" | sed 1d | tr -s ' ' | cut -d" " -f,4
;;
HP-UX )
$DF -b "$JUNK" | tr -s ' ' | cut -d" " -f,5
;;
AIX )
$DF -k "$JUNK" | sed 1d | tr -s ' ' | cut -d" " -f,3
;;
OSF1 )
$DF -k "$JUNK" | sed 1d | tr -s ' ' | cut -d" " -f,4
;;
*)
echo "${ERR_OS_UNSUPPORTED}"
exit 1
esac
} |