Dr.Ruud wrote:
Chad Perrin schreef:
Dr.Ruud:
TIMTOWTDI. On the shell machines of my provider (FreeBSD) the "id"
approach will work, and the "/etc/group" one won't.
I don't think that has anything to do with it being FreeBSD.
That was and is also what I don't think. I only mentioned it because OP
mentioned "This should work on any *nix system".
Yeah, that's very strange. I figured every *nix system would have an
accessible /etc/group file--else, how's one to know which groups they're
a member of when they log in?
Of course, if you're going to call out of the Perl script to the id
utility, you may as well skip the Perl script entirely and just enter
this at the shell prompt:
id -Gn username
That depends on what OP needs to do with the result. It could be part of
a larger Perl script that is doing other stuff as well.
Yeah, it is part of a larger script. It's running on a Linux server and
manipulating some Samba stuff for the Win32 clients.
I try to avoid calling console commands because there tends to be
differences in some of the CLI utilities between distributions--that was
actually one of the first things I had considered doing, except with the
`groups` command.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>