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 use of the -w flag generates "Use of uninitialized value in substr" in Coe.pm use strict; use Coe; my $VERSION="1.1.4.1"; my $scope; my $arg1; my $OSFILE; my $uid; my @p; $scope="local"; $arg1=cleanString(shift,1); if ("$arg1" eq "-s" || "$arg1" eq "--scope") { $scope=cleanString(shift,1); } if ("$scope" eq "global" || "$scope" eq "g") { $scope="global"; $uid=15000; } else { $uid=10100; } $OSFILE=readFile("/etc/passwd"); while (<$OSFILE>) { @p=split(":"); if ("$scope" eq "global" && $p[2]>15000 && $p[2]<19999) { if ($p[2]>$uid){$uid=$p[2];} } elsif ($p[2]>10100 && $p[2]<15000) { if ($p[2]>$uid){$uid=$p[2];} } } close $OSFILE; $uid=$uid+1; $uid=cleanString("$uid", 0); print "$uid\n"; |
© 2003, Federal Linux Systems |