Operating System - HP-UX
1753865 Members
7469 Online
108809 Solutions
New Discussion

Re: collect user information

 
krissh89
Occasional Advisor

grep user information

HI

 

I need to get user information like

 

username,account status,shell,gecos,passwd expiry staus .

 

I was not able to get all in a single command.

 

i need to take it for more thn 300 servers.

 

Is there any way to get those.

 

I ws able to get above information from passwd -sa and cat /etc/passwd file

 

but I need to merge bth output in a single command.

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: collect user information

If you know how to get the info from the two commands, you can just write a script that combines the output.

krissh89
Occasional Advisor

Re: collect user information

Hi 

 

I used this command to merge the output, but I was not successfull.

 

{ command1 & command2; }

 

could you help me in merging the outputs.

Dennis Handly
Acclaimed Contributor

Re: collect user information

>{ command1 & command2; }

 

This will run the first in the background.

If these two commands produce one line of output for one user, you can simply use:

{ command1; command2; }

 

If these two commands produce output for multiple users then you need to merge the info from each, provided there are a fixed number of lines for one command.

 

If files are sorted and one line each and the "key" is first, you can use join(1).