[alt.sources] adf - Another disk free program for SYSV

jeff@quark.WV.TEK.COM (Jeff Beadles) (08/31/90)

[ Note - This does not have an archive header, as it's a beta release]

This is a wrapper for df, that will give you all sorts of cutesy information.

The documentation is in the comments at the start of the script.

If you have any comments, suggestions, or other useful information, please drop
me a note.

	-Jeff
-- 
Jeff Beadles				jeff@quark.WV.TEK.COM 
Utek Engineering, Tektronix Inc.	+1 503 685 2568
			SPEEA - Just say no.


#--------------------------------CUT HERE-------------------------------------
#! /bin/sh
#
# This is a shell archive.  Save this into a file, edit it
# and delete all lines above this comment.  Then give this
# file to sh by executing the command "sh file".  The files
# will be extracted into the current directory owned by
# you with default permissions.
#
# The files contained herein are:
#
# -rwxr-xr-x  1 jeff         1436 Aug 30 10:23 adf
#
echo 'x - adf'
if test -f adf; then echo 'shar: not overwriting adf'; else
sed 's/^X//' << '________This_Is_The_END________' > adf
X#!/bin/sh
X##
X## Another df, for Sysv.  Works with local or remote filesystems.  Version 2.0
X##
X## Tossed together and released to the public domain by Jeff Beadles,
X##							jeff@nitwit.wv.tek.com
X##
X## I'm not responsible if this turns your system into a pile of molten silicon,
X## or anything else. :-)
X##
X## The 'sed' line removes the '(' and '):' from around the remote filesystem
X## name.  By default it looks like   "(nitwit:/usr3   ):", and joins the
X## two lines together. (free space and total space.).  The awk script does the
X## math, and "pretty printing".
X##
X##
X## This expects df -t output to look like:
X##
X## /        (/dev/dsk/c-0d00s0 ):    91468 blocks   109921 i-nodes
X##                    total:   467558 blocks  118400 i-nodes
X##
X## And will give output like:
X##
X## Filesystem                             MB Used  MB free   MB total   % full
X## /                                          188       45        233      80%
X##
X## Options:  (Same as df, except the '-t' flag is always on.)
X##
X## Some of the more useful options are:
X##	'-l' = local disk information only.
X##	'dir' = Free space on dir.  (ie adf /usr2)
X##
X
Xdf -t $* | sed -e 's/[)(:]//g' -e '/$/N' -e 's/\n/ /' |
X    awk ' BEGIN {
X	printf "%-40s  MB Used  MB free   MB total   %% full\n", "Filesystem" }
X        { printf "%-40s     % 4d     % 4d      % 5d     %3d%%\n", \
X	$1, ($8 - $3) / 2000, $3 / 2000, $8 / 2000, 100 - ($3 / $8 * 100)
X    }'
Xexit 0
________This_Is_The_END________
if test `wc -c < adf` -ne 1436; then
	echo 'shar: adf was damaged during transit (should have been 1436 bytes)'
fi
fi		; : end of overwriting check
exit 0