Getting groups you belong to in perl
Andrey Repin
anrdaemon@yandex.ru
Fri Mar 14 11:37:00 GMT 2014
Greetings, PANEL Vincent (CIS/SIN)!
> Don't know if this list is more appropriate than the Perl one but my
> question is actually about porting a Perl script to Cygwin. I need to check
> if the current user running the script belongs to a pre-defined group.
> Under *nix, I get the list of users belonging to the group and see if the
> current user is in this list.
How exactly you are doing this? (I hope you're not reading it from /etc/group,
because that file may not exist at all, or contain exactly zero relevant
information.)
> Cygwin doesn't allow this way of working.
Oh... ?
> I found out by reading the thread "Why mkgroup does not list group members?"
> on this mailing list (1 message on Mon, 13 May 2013 20:29:52, for instance).
> I would like to use perl commands without launching external commands, if
> possible. The way I've found until now is by using the output of the "id"
> command but I was wondering if there was another way to do it. How is "id"
> command working by the way ?
You can check the sources of it, it's really a very simple tool.
(It's coreutils, by the way.
http://mirrors.kernel.org/sourceware/cygwin/x86/release/coreutils/ )
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 14.03.2014, <02:12>
Sorry for my terrible english...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list