removing users from /etc/group

H

heylow

Hi Gurus:

I have a master file /etc/group, and another file contains logins
(say, master.login). I want to delete all users in /etc/group, who do
not exist in this master.login

master.login
-----------
abel
dan
cory
sia


/etc/group:
------
gr001:x:500:abel, x,y,z,sia
gr002:x:501:a,b, dan
gr003:x:610:cory, dan, x, a


I wanted to remove users (a, b, x, y, z) who do not exist in
master.login from the /etc/group, so that i can get clean group file.

Thanks for your help.

Pedro.
 
H

Henry Law

heylow said:
I have a master file /etc/group, and another file contains logins
(say, master.login). I want to delete all users in /etc/group, who do
not exist in this master.login
I wanted to remove users (a, b, x, y, z) who do not exist in
master.login from the /etc/group, so that i can get clean group file.

You could write some Perl to do that; doesn't look too hard. Why not
have a go and come back here when you hit a snag? People here would be
delighted to help you overcome it.
 
T

Tad McClellan

heylow said:
I have a master file /etc/group, and another file contains logins
(say, master.login). I want to delete all users in /etc/group, who do
not exist in this master.login


Start with this FAQ:

perldoc -q intersection

How do I compute the difference of two arrays? How do I compute the
intersection of two arrays?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,674
Latest member
scazeho

Latest Threads

Top