DataMuseum.dk

Presents historical artifacts from the history of:

RC9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: @ T g

⟦460243c5e⟧ TextFile

    Length: 1104 (0x450)
    Types: TextFile
    Notes: @(#)getfilesize.sh 13.2 (RC International) 91/07/25
    Names: »getfilesize«

Derivation

└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
    └─⟦bbf173f5c⟧ »0004« 
        └─⟦this⟧ »./usr/sadm/sysadm/bin/getfilesize« 

TextFile

#!/sbin/sh
#	@(#)getfilesize.sh	13.2 (RC International) 91/07/25

#	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 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.

#ident	"@(#)oamintf:files/bin/getfilesize.sh	1.3"

# getfilesize.sh

echo "" >/tmp/file.size

fsys=${1}
nfiles=${2}

cd ${fsys}

a="`expr 0${nfiles} "*" 10`"
du -ax  |
	sort -bnr +0 -1  |
	sed -n 1,0${a}'s:^[0-9]*	\./:ls -ldsu :p'  |
	sh -  |
	grep -v '^ *[0-9][0-9]* d'  |
    awk '$6 ~ /[^A-Za-z]/  ' |
	sed -n 1,0${nfiles}p  |
	sort -bnr +5 -6 |
	cut -c20-28,38- > /tmp/$$filesize

afiles="`cat /tmp/$$filesize  |  wc -l  |  cut -c5-`"

if [ "${nfiles}" -ne "${afiles}" ]
then
	nfiles=${afiles}
	echo "
   There are ${nfiles} files in `pwd`.\n" >/tmp/file.size
fi
echo "\nThe ${nfiles} largest files in `pwd`:\n 
        file size date of
owner    (chars)  last access  filename
-----   --------- ------------ --------" >>/tmp/file.size
cat /tmp/$$filesize >>/tmp/file.size
rm /tmp/$$filesize