Home: Perl Programming Help: Advanced:
Using getgrent() on external Group File



chtaylo2
New User

Nov 11, 2009, 10:39 AM


Views: 3627
Using getgrent() on external Group File

Perl has built in group search functions such as getgrent(), getgrnam(), etc.
When using them, they look at the /etc/group file on your unix box. Is there a way to specify a different file these functions look at?


Background: I'm creating a system which pulls in the group file modifies it and pushes out a new one. The issue is, /etc/group is not actual file it modifies, however it is in all the same format.



Thanks!
Chris


FishMonger
Veteran / Moderator

Nov 11, 2009, 12:11 PM


Views: 3617
Re: [chtaylo2] Using getgrent() on external Group File


Quote
I'm creating a system which pulls in the group file modifies it and pushes out a new one.


Wrong/bad approach

You should not edit the files manually. You should ssh into the remote system and execute the appropriate utility that updates the required file.


chtaylo2
New User

Nov 11, 2009, 12:18 PM


Views: 3614
Re: [FishMonger] Using getgrent() on external Group File

Before telling me I'm doing it wrong, can you help me solve my issue ? This is a NIS+ system so group files are not locally stored. I'm trying to keep my post as simple as possible...no reason to explain all of this.



Does anyone know how to do this?

Thanks in advance!