|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: Want to Create Unix group using perl scriptby almut (Canon) |
| on Mar 17, 2010 at 14:01 UTC ( #829175=note: print w/ replies, xml ) | Need Help?? |
|
For checking if a group exists you can use getgrnam (scalar getgrnam("foo") — returns the GID, or undef if a group of the given name doesn't exist). For creating a new group, I'd use the respective command supplied by your system, such as groupadd (call it via system) — there's no reason to reinvent the wheel and run into various gotchas that can be avoided by using existing tools.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||