| Last published: Wed Oct 8 10:18:30 MDT 2003 | Doc for 1.1.4.1 |
|
Programmer's Reference
COE_API:COE
COE_API:OS_Linux
COE_API:OS_Windows
COE_API:UAM
COE_API:UserMgmt
COE_CVS
COE_ManPages:COE
COE_ManPages:UserMgmt
COE:SegmentationGuide
|
#!/usr/bin/perl -T -I/h/COE/lib
#- the -w flag gives a "Use of unitialized value in substr" error in Coe.lib
use strict;
use Coe;
my $VERSION="1.1.4.1";
my $scope="local";
my $arg1;
my @p;
my $gid="10100";
my $gid1="10100";
my $OSFILE;
$arg1=cleanString(shift,1);
if ("$arg1" eq "-s" || "$arg1" eq "--scope") {
$scope=cleanString(shift,1);
}
if ("$scope" eq "global" || "$scope" eq "g") {
$scope="global";
$gid=15000;
} else {
$gid=10100;
}
$OSFILE=readFile("/etc/group");
while (<$OSFILE>) {
@p=split(":");
if ("$scope" eq "global" && $p[2]>15000 && $p[2]<19999) {
if ($p[2]>$gid){$gid=$p[2];}
} elsif ($p[2]>10100 && $p[2]<15000) {
if ($p[2]>$gid){$gid=$p[2];}
}
}
close $OSFILE;
$gid=$gid+1;
$gid1=cleanString($gid,0);
print "$gid1\n";
|
| © 2003, Federal Linux Systems |