But Why do you want the next available uid,
If it was for adding a new user I would suggest You use /sbin/useradd
command rather than attempting to write into passwd directly. I did this
that mistake for one of my projects and find myselyf in a soup many a times
Ram
Anidil Rajendran wrote:
On Sunday, September 1, 2002, at 02:44 , John W. Krahn wrote:
[..]
> According to getpwent(3) on my system it just reads from /etc/passwd.
I believe we both agree on some of the language of getpwent(3),
the vol 3 manual page, and that it asserts:
"The functions getpwnam() and getpwuid() sea
Drieux wrote:
>
> On Sunday, September 1, 2002, at 01:53 , John W. Krahn wrote:
> [..]
> > The only UID that should be above 6 is the user "nobody" whose UID
> > is 65534.
>
> you know and I know - what would be 'reasonable'
> and what happens
> [..]
> >
> > while ( my( undef, undef, $ui
On Sunday, September 1, 2002, at 01:53 , John W. Krahn wrote:
[..]
> The only UID that should be above 6 is the user "nobody" whose UID
> is 65534.
you know and I know - what would be 'reasonable'
and what happens
[..]
>
> while ( my( undef, undef, $uid ) = getpwent ) {
> $highestuid
Anidil Rajendran wrote:
>
> Hi Perl Gurus,
Hello,
> This is a newbie question ofcourse. Since it is not working for me I am asking here.
> I am trying to skip UID above 6.
The only UID that should be above 6 is the user "nobody" whose UID
is 65534.
> $passwd = "/etc/passwd";
> $skip
On Sunday, September 1, 2002, at 12:46 , ANIDIL RAJENDRAN wrote:
[..]
> $passwd = "/etc/passwd";
> $skip = 6;
> open(PW,$passwd) or die "Can't open $passwd:$!\n";
> while (){
> @fields = split(/:/);
> next if $fields[2] > $skip;
> $highestuid = ($highestuid < $fields[2]) ? $fields
Hi Perl Gurus,
This is a newbie question ofcourse. Since it is not working for me I am asking here.
I am trying to skip UID above 6.
$passwd = "/etc/passwd";
$skip = 6;
open(PW,$passwd) or die "Can't open $passwd:$!\n";
while (){
@fields = split(/:/);
next if $fields[2] > $skip;