On Thu, Jul 11, 2002 at 11:52:23AM +1000, Matthew Palmer wrote:
> On Thu, 11 Jul 2002, Simon Bryan wrote:
> > I am looking for a way to pipe the members of a particular group on a RH7.2
> > system to a file. Is there such a command, or at least the list members
> > command?
>
> Something like this will work:
>
> grep groupname /etc/group | cut -d : -f 4 | sed s/,/ /
>
> That'll give you the group members as a space separated list.
Perlesque equivalent:
perl -e 'print((getgrnam("groupname"))[3], "\n")'
Cheers,
Gavin
--
Fashion is a variable, but style is a constant - Programming Perl
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug