summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/eg/changes
blob: 1d7ec598eee482b60a61c878f924474159f25dbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl -P

# $RCSfile: changes,v $$Revision: 1.3 $$Date: 1999/04/29 22:51:17 $

($dir, $days) = @ARGV;
$dir = '/' if $dir eq '';
$days = '14' if $days eq '';

# Masscomps do things differently from Suns

#if defined(mc300) || defined(mc500) || defined(mc700)
open(Find, "find $dir -mtime -$days -print |") ||
	die "changes: can't run find";
#else
open(Find, "find $dir \\( -fstype nfs -prune \\) -o -mtime -$days -ls |") ||
	die "changes: can't run find";
#endif

while (<Find>) {

#if defined(mc300) || defined(mc500) || defined(mc700)
    $x = `/bin/ls -ild $_`;
    $_ = $x;
    ($inode,$perm,$links,$owner,$group,$size,$month,$day,$time,$name)
      = split(' ');
#else
    ($inode,$blocks,$perm,$links,$owner,$group,$size,$month,$day,$time,$name)
      = split(' ');
#endif

    printf("%10s%3s %-8s %-8s%9s %3s %2s %s\n",
	    $perm,$links,$owner,$group,$size,$month,$day,$name);
}