c has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know of a module that replicates the groupadd/addgroup command in unix? Right now, I am creating the group manually, by reading in /etc/group, finding the highest gid, adding one to it and then appending the new info in the correct format to the end of the file. I now have a system that uses gshadow. Turning off a shadowed groupfile isnt too difficult, but if there was a module out there that dealt with groups, so much the better.

humbly -c

Replies are listed 'Best First'.
Re: Creating a new Unix group
by BeernuT (Pilgrim) on Mar 24, 2002 at 16:51 UTC
    A simple search at CPAN keyword 'group' reveals Unix::GroupFile which looks to deal with UNIX group files.

    -bn
•Re: Creating a new Unix group
by merlyn (Sage) on Mar 24, 2002 at 16:46 UTC
    I don't know specifically which of "groupadd" or "addgroup" isn't interactive, but I presume one of them is, so what's wrong with simply invoking them from your Perl program?

    -- Randal L. Schwartz, Perl hacker