summaryrefslogtreecommitdiff
path: root/eg/dus
blob: 8c7ff94340330d90c0b8edd93ff96c8bf4a0eac2 (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

# $Header: dus,v 2.0 88/06/05 00:16:44 root Exp $

# 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;