in reply to adding a group to the Unix System

Not specifically answering your question, but be aware that Perl has a number of built-in functions relating to users and groups, for example: getlogin, getpwnam, getgrent. See Perl functions for fetching user and group info.

And it is usually preferable to use the Perl builtin function rather than an external command (for why, see Unix shell versus Perl).

Though I am not aware of a Perl builtin function that can add a Unix group, you could use them to help you verify the changes you make. To illustrate, the test program below prints all groups on the system along with which users are in each group:

use strict; use warnings; my $user = getlogin(); my ($uid, $primarygid, $home, $shell) = (getpwnam($user))[2,3,7,8]; defined($uid) or die "$0: error user '$user' does not exist\n"; print "user='$user' primary gid=$primarygid\n\n"; while (my ($name, $pw, $gid, $members) = getgrent) { print "gid : $gid\n"; print "group name : $name\n"; print "members : $members\n\n"; } endgrent();

Replies are listed 'Best First'.
Re^2: adding a group to the Unix System
by deyaneria (Acolyte) on Mar 15, 2015 at 21:25 UTC
    Thanks for the link...I got the groups being added now just need to figure out how to add a new user to an existing group and a new group. I'm hoping your link might help with that.I've had 2 weeks of UNIX and 2 weeks of Perl now in the one class. It seems to be kicking my butt:) But I will plow through:)