SPUG:Confused field parser seeks...

Aaron Paul kalistibot at yahoo.com
Sun May 25 01:56:24 CDT 2003


Thanks that worked great.  Here's my get_newuid:

sub get_newuid{
my @lines;
my $lastline;
my $olduid;
my ($f1, $f2, $f3, $f4, $f5, $f6, $f7);
open (PASS,  $draft);

@lines = <PASS>;
close(PASS);
$lastline = pop(@lines);
($f1,$f2,$f3,$f4,$f5,$f6,$f7)=split /:/, $lastline;

$newuid = ++$f3;

return $newuid;
}            

--- Brian Hatch <spug at ifokr.org> wrote:
> 
> 
> > my $var="nobody:x:99:99:Nobody:/:/sbin/nologin";
> > 
> > $var=~ /(.+):(.+):(.+):(.+):(.+):(.+):(.+)/;
> 
> Any reason you don't just want to use
> 
> 	($username,$uid,$gid.....) = split /:/, $var;
> 
> --
> Brian Hatch                  "The One leads us. The
> One
>    Systems and                tells us to go, we go.
> We
>    Security Engineer          live for the one. We
> http://www.ifokr.org/bri/     would die for The
> One."
> 
> Every message PGP signed
> 

> ATTACHMENT part 2 application/pgp-signature 



__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com



More information about the spug-list mailing list