# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.
#ident	"$Header: diskuse 1.2 89/10/10 $@(#)sadmin:admin/menu/filemgmt/diskuse	2.4"
#menu# display how much of the built-in disks are being used

#help# 
#help#	Diskuse lets you know what percentage of the built-in disks are
#help#	currently occupied by files.  The list is organized by file
#help#	system names.

fslist=`/etc/mount  |  cut -d' ' -f1  |  sort`
echo "
FILE SYSTEM USAGE AS OF" `date '+%m/%d/%y %T'` "

File		Free	Total	Percent
System		Blocks	Blocks	Full
------		------	------	-------"
for fs in ${fslist}
{
	eval `df -t ${fs}  |
		sed '	1s/.*): *\([0-9]*\) .*/free=\1/
			2s/[^0-9]*\([0-9]*\) .*/total=\1/'`
	if [ "${total}" -gt 0 ]
	then
		percent=`expr \( ${total} - ${free} \) \* 100 / ${total}`%
	else
		percent=
	fi
	echo "${fs}		${free}	${total}	${percent}"
}
