How to list group members in solaris 9

Hi,

I already gone through with old post regarding listing the group members and tried the command
getenv group other
the result is

other::1:root

i listed my part of the /etc/passwd file below
test1:x:100:1::/home/test1:/bin/sh
test2:x:101:1::/home/test2:/bin/ksh
test3:x:102:1::/home/test3:/bin/ksh

the above three users belong to the other group but the username are not listed in the result.
please let me know the correct way of listing the group members

Thanks
Maro

You mean:
getent group other

Your group file isn't correctly maintained. There is no much thing to do outside parsing the password table which would be trivial.

Hi

My command is
getenv group other

the result is only

                other::1:root

Note : i think the genent command is just fetch the string from the /etc/group file.But in the group fiile the last field "user list" only list the secondary users of the group.but i like to list the primary group of the users. please let me know any other way to list the group members

`/usr/bin/logins -g other`

or

`/usr/bin/logins -o -g sys`

depending on how you need it formatted.

`man logins` for more information.

By the way; you're all fired. Turn in your badges at the front desk.

Hi Seg

Thanks for your reply.Will your command provide the answer for only loged in users or it will list all the users in that group (including those are not logged in)...

Thanks
Maro

Thanks seg for the tip. I had forgotten the logins command.

vr_mari: not sure about why you insist telling you use getenv while the output clearly shows you run getent. By the way, getent not only look in the /etc files but also in whatever remote database (nis, ldap, ...) might be declared in nsswitch.conf.

The "logins" command lists all users whether or not they are logged in.

Thanks for your help . Its working great....