perl 3.0: (no announcement message available)
[p5sagit/p5-mst-13.2.git] / eg / dus
CommitLineData
378cc40b 1#!/usr/bin/perl
2
a687059c 3# $Header: dus,v 3.0 89/10/18 15:13:43 lwall Locked $
378cc40b 4
5# This script does a du -s on any directories in the current directory that
6# are not mount points for another filesystem.
7
8($mydev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
9 $blksize,$blocks) = stat('.');
10
11open(ls,'ls -F1|');
12
13while (<ls>) {
14 chop;
15 next unless s|/$||;
16 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
17 $blksize,$blocks) = stat($_);
18 next unless $dev == $mydev;
19 push(@ary,$_);
20}
21
22exec 'du', '-s', @ary;