By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,835 Members | 2,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,835 IT Pros & Developers. It's quick & easy.

how to add the user to one unix group using perl

P: 7
Hi

I just wanted to know is there any way in the perl to add a unix user to unix group.
e.g.
I linux we have command to do so,
Expand|Select|Wrap|Line Numbers
  1. usermod -a -G <group> <user>
I have found a CPAN perl module Linux:usermod to do so,Is there any other way except this module ?

Regards,
Ritusriv
Nov 12 '08 #1
Share this Question
Share on Google+
3 Replies


nithinpes
Expert 100+
P: 410
Alternatively, you can make use of system() command or backticks in Perl, to execute the same linux command.
Nov 12 '08 #2

P: 7
Alternatively, you can make use of system() command or backticks in Perl, to execute the same linux command.
Thats true but I just wanted to confirm that Is there any way in Perl to do so..
Nov 13 '08 #3

nithinpes
Expert 100+
P: 410
Thats true but I just wanted to confirm that Is there any way in Perl to do so..
There is no straight forward method of doing it in Perl, as far as I know. You have to make use of certain modules. Other than the one you mentioned, you can have a look at Unix::GroupFile module.

- Nithin
Nov 13 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.