summaryrefslogtreecommitdiff
path: root/t/op/groups.t
blob: f8cb4cad582f25f71ec1d0b94eb357e05513e082 (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
#!./perl

if (! -x '/usr/ucb/groups') {
    print "1..0\n";
    exit 0;
}

print "1..1\n";

for (split(' ', $()) {
    next if $seen{$_}++;
    ($group) = getgrgid($_);
    if (defined $group) {
	push(@gr, $group);
    }
    else {
	push(@gr, $_);
    }
} 
$gr1 = join(' ',sort @gr);
$gr2 = join(' ', sort split(' ',`/usr/ucb/groups`));
#print "gr1 is <$gr1>\n";
#print "gr2 is <$gr2>\n";
print +($gr1 eq $gr2) ? "ok 1\n" : "not ok 1\n";