View Single Post

  #7 (permalink)  
Old 05-19-2008, 01:34 AM
rockdalinux's Avatar
rockdalinux rockdalinux is offline
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 576
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default Listing the Members of a Group

So you want command to print ALL members of a group. For example, if I type
somecommand GROUPNAME

It should print list of users in both primary and secondary group. Am i right? if so you need to write a small shell script to query both /etc/passwd and /etc/group. Lemme know so that I can come with something.

edit: Have you tried members command?

Code:
members  --all groupname
members  --all ftp
From the man page:
members is a program that sends a space-separated list of secondary and primary member names to its standard output.
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat

Last edited by rockdalinux; 05-19-2008 at 01:40 AM.
Reply With Quote