Re: Skipping the UID above 60000

2002-09-02 Thread Ramprasad A Padmanabhan
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:

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
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

Re: Skipping the UID above 60000

2002-09-01 Thread John W. Krahn
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

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
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

Re: Skipping the UID above 60000

2002-09-01 Thread John W. Krahn
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

Re: Skipping the UID above 60000

2002-09-01 Thread drieux
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

Skipping the UID above 60000

2002-09-01 Thread ANIDIL RAJENDRAN
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;