Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 06:25 AM
05-17-2002 06:25 AM
I'd like to display the list of members within a groups.
I used the following instruction:
grep $1 /etc/group | nawk -F: '{print " ",$4}'
that gives me the list of ids but I would like
to get users identity with a mix of /var/yp/src/passwd content.
Thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 07:05 AM
05-17-2002 07:05 AM
Re: groups
grpid=`awk /^$1:/{print $3}`
Then to get the list of users for that group (users that are defined in NIS)-
ypcat passwd | awk -F: -v gid=$grpid '$4==gid{print $1}'
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2002 07:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 01:33 AM
05-21-2002 01:33 AM
Re: groups
thanxs for your answer and help.
I tried your solution. It works but not totally what U expected.
In fact using "ypcat passwd" not give the groups I want, I had to use /etc/group that contains all created groups.
so I use cat /etc/group instead of ypcat group.
But the problem is the ouput. The output from your instruction is the group id. Is there a file in which we have the list of groups that belongs to a user???
If I use the uid parameter in output, I have the list of user within the group with the following format uid1,uid2,uid3 so using the second instruction to get users name, it does not match.
Do you see my new pb?
Thanx by advance.
Regards,
Johann
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 01:47 AM
05-21-2002 01:47 AM
Re: groups
cat /etc/passwd | cut -d: -f1 | while read user
do
echo "$user: \c"
groups $user
done
You can of course replace 'cat /etc/passwd' with 'ypcat passwd' if you need to...
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2002 04:30 AM
05-21-2002 04:30 AM
Re: groups
In fact Rodney solution was quite the one I expected.
I would like to create a script "toto groupname" that gives me the list of the users that belong to the groupname. Not their ID but their complete identity from passwd file.
Rodney proposed in the 1st instruction to check group id in group file. As for me, this file does only contain system groups, for my use I need to work with /etc/group file.
The proposed solution refers to group id in order to check users' identity within passwd. But passwd file does not seem to list all groups for a user.
So, in my tests, I tried to select the userid's list instead of groupid and then to link each uid to the required line in passwd file. But I don't know how. Because the result of the 1st instruction is uid1,uid2,uid3...
I think it would be possible with a do instruction but my knowledeges are limited in UNIX environment.
Thanx by advance for any help.
Regards,
JG