summaryrefslogtreecommitdiff
path: root/eg/dus
blob: 3025e2bac1ccc0effd7bb62e0e13b8898ab906c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/perl

# $RCSfile: dus,v $$Revision: 4.1 $$Date: 92/08/07 17:20:11 $

# This script does a du -s on any directories in the current directory that
# are not mount points for another filesystem.

($mydev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
   $blksize,$blocks) = stat('.');

open(ls,'ls -F1|');

while (<ls>) {
    chop;
    next unless s|/$||;
    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
       $blksize,$blocks) = stat($_);
    next unless $dev == $mydev;
    push(@ary,$_);
}

exec 'du', '-s', @ary;