On Jan 22, 2008 9:24 PM, Tom Phoenix <[EMAIL PROTECTED]> wrote:
> On Jan 22, 2008 5:49 PM, Vahid Moghaddasi <[EMAIL PROTECTED]> wrote:
>
> > I have the following
> > subroutine  to sort unique a UNIX password file based on UID and
> > username.
>
> Doesn't your password file already have unique usernames and unique UIDs?

No. 20,000 users after three merger.

>
> > But the problem is that some of the users get disappeared
> > the output password file. I couldn't figure out the pattern of user
> > disappearance but always the same few users are filtering.
>
> Why aren't you telling us which ones they are? It would help if you
> supplied some sample data that shows the problem you're having.
>

# egrep "^bin:|^adm:|^daemon:|^root:|^rpm:" /etc/passwd
root:x:0:0:Linux root:/root:/bin/bash
bin:x:1:1:Linux bin:/bin:/sbin/nologin
daemon:x:2:2:Linux daemon:/sbin:/sbin/nologin
rpm:x:37:37:Linux :/var/lib/rpm:/sbin/nologin

daemon is missing.
# grep daemon passwd.all
daemon:x:2:2:Linux daemon:/sbin:/sbin/nologin
daemon:x:1:1:System account #8545740:/:
but both get filtered out.

> From the look of your code, the output should be missing some whose
> UID or username are duplicates; are those the ones you can't find?

Why should be abything missing? I meant the code to keep the first
copy of the duplicate and throw any identical after that. For example,
if there are three "root" with UID "0" just keep the first and discard
the other two.

Thanks.
>
> Cheers!
>
> --Tom Phoenix
> Stonehenge Perl Training
>



-- 
This e-mail address is not monitored so please do not send me anything
important here. Thanks.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to