home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / src / perl / eg / dus < prev    next >
Text File  |  1992-04-11  |  557b  |  23 lines

  1. #!/usr/bin/perl
  2.  
  3. # $Header: dus,v 4.0 91/03/20 01:09:20 lwall Locked $
  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.  
  11. open(ls,'ls -F1|');
  12.  
  13. while (<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.  
  22. exec 'du', '-s', @ary;
  23.