AIX os level 6.1 for list of users and groups


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AIX os level 6.1 for list of users and groups
# 1  
Old 10-26-2010
AIX os level 6.1 for list of users and groups

I have a AIX server o/s 5.3.0.0 and a few at o/s 6.1.0.0
The issue I am haveing is running this on the server with o/s of 5.3 works good but not on the o/s of 6.1 any help out here??
Code:
#!/usr/bin/ksh
user -a pgrp groups ALL |awk '{print $1}' > a1
lsuser -a pgrp groups ALL |awk '{print $2}'|cut -f2 -d= > a2
lsuser -a pgrp groups ALL |awk '{print $3}'|cut -f2 -d= > a3
echo "name pgrp group" > list_of_user
echo "-----------------------" >> list_of_user
paste a1 a2 a3 >> list_of_user
rm a1 a2 a3


Last edited by Franklin52; 10-26-2010 at 02:31 PM.. Reason: Please use code tags
# 2  
Old 10-26-2010
Are you saying those commands do not work? Which of the 5?
# 3  
Old 10-26-2010
The code works fine on the older o/s the 5.3 but not on the 6.1
# 4  
Old 10-26-2010
Do the three a? files come out the same?
# 5  
Old 10-26-2010
first you need compare if output format are same in AIX 5 or 6 by below command:

Code:
lsuser -a pgrp groups ALL

my AIX 5 sample output:

Code:
root pgrp=system groups=system,bin,sys,security,cron,audit,lp

Second, your command can be rewritten by one command, no temp file need be generated.

Code:
lsuser -a pgrp groups ALL |sed 's/pgrp=//;s/groups=//'

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Creating groups and users

Hi Could anyone please suggest how we can check in Linux if a user or a group name is already existing? In case of a user the command should also be able to specify the user with a given directory and shell. We can of course check this using a grep command but since that is just a pattern match,... (12 Replies)
Discussion started by: Dorothy
12 Replies

2. UNIX for Dummies Questions & Answers

Users in multiple groups?

Happy Thanksgiving Everyone!! I have a question about adding users to multiple groups. Thanks in advance Using Red Hat and here are the issues: Example: Users: Bob Mark Groups: SystemsAnalysts BusinessAnalysts If I am adding a user Bob to both groups (SystemsAnalysts and... (2 Replies)
Discussion started by: hansokl
2 Replies

3. UNIX for Dummies Questions & Answers

List users and groups

Hi I am new to unix so hopefully someone can help. I need to list all the users I have in my unix enviroment (AIX) and the groups (primary and secondary) they belong to. Can anyone help? Many thanks in advance (2 Replies)
Discussion started by: m3y
2 Replies

4. Emergency UNIX and Linux Support

List of users on an AIX system

Is there a way to generate a list of users with name, user ID, and Security Group? It is urgent for audit purposes. Please help. (5 Replies)
Discussion started by: ggayathri
5 Replies

5. Solaris

Removing users from groups

How do I remove a user from a group? I'm using the usermod command but its not working. I have a user "abc" who is a member of the groups root and other. I'm trying to remove him from the group "other" (using CLI) which is his secondary group but it's not working. How do I do this? Is there any... (11 Replies)
Discussion started by: the_red_dove
11 Replies

6. AIX

Vulnerability AIX server (GROUPS/USERS) and SAP Systems ?

I hope you can understand me, although my english is not so good. I have a problem. I have installed 4 SAP Systems with different releases on the same server (AIX). Each SAP system has got its own operating system user through the installation. But all users belong to the group SAPSYS. So in other... (3 Replies)
Discussion started by: momok1976
3 Replies

7. Solaris

Defaults number of users and Groups

Hi All, I would like know how many of default number of users and groups are there in solaris-10... Regards Tirupathi Raju (2 Replies)
Discussion started by: tirupathiraju_t
2 Replies

8. UNIX for Dummies Questions & Answers

users and groups

hi eveyone i've recently requested my unix admin to create a userid for 2 groups. He created the id and i can see it by grep "id" /etc/group. But when i login with that id into unix and try to cd that group it says permission denied. something like cd /groupname -- permission denied Can my admin... (1 Reply)
Discussion started by: sammet
1 Replies

9. Linux

listing users and groups

RH 7.2 I'm trying to list the users & groups on my machine. I found the lsuser & lsgroup commands but no associated man pages. I typed: lsuser I get --> Valid options are: -a So I typed: lsuser -a I get --> Valid options are: groups, home So I typed: lsuser -a groups I get -->... (2 Replies)
Discussion started by: jalburger
2 Replies

10. Cybersecurity

Users and groups

Hi, Is it possible that one user belongs to many groups, or the relation of user/group is 1/1?. Thanks Ramón (2 Replies)
Discussion started by: rsanz
2 Replies
Login or Register to Ask a Question