|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1353 (0x549) Types: TextFile Notes: UNIX file Names: »dfspace«
└─⟦9432394ce⟧ Bits:30004042/fmhelp.imd SW95705I 386/ix Multi-user Release 1.2 └─⟦9432394ce⟧ UNIX Filesystem └─⟦this⟧ »fm/new/etc/dfspace«
# Copyright (c) 1984 AT&T # All Rights Reserved # THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T # The copyright notice above does not evidence any # actual or intended publication of such source code. # "@(#)dfspace 1.3 - 88/03/17" # dfspace - d(isk) f(ree) space # Calculate available disk space in mounted filesystems. # Filesystem may be 1K bytes/block, but, # df uses 512 bytes/block for reporting. # get free and allocated space. # Free space either arg 3 or 4 depending on intervening white space. df -t | awk ' BEGIN { Blksize=512; Mbyte=1048576; CONST = Blksize / Mbyte; free = -1 } { if (free == -1) { # -1 used because 0 could be valid name = $1 if ( substr($3, 1, 2) != "):" ) free = $3 else free = $4; } else { alloc = $2; if ( free != 0 ) f = (free * CONST) - .005 else f = 0; t = (alloc * CONST) - .005; # force rounding down. PCT=free * 100 / alloc; printf ("Disk space ( %-10s): %#5.2f MB of %#6.2f MB available (%#5.2f%%),\n",name,f,t,PCT); Tfree += free; Talloc += alloc; free = -1; } } END { TFREE= (Tfree * CONST) - .005 # force rounding down. TALLOC= (Talloc * CONST) - .005 # force rounding down. PCT=Tfree * 100 / Talloc printf ("\nTotal disk space: %#.2f MB of %#.2f MB available (%#.2f%%).\n", TFREE, TALLOC, PCT) }'