Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi all visitors
i want to write one shell script.
my purpose is i want to check existing group in system.
i dont know how to check existing group.
Please anybody help me how to check existing group in system?
Thanks
Posted

1 solution

Use cat /etc/group to list the entries in your group file, and a combination of awk and other commands to check whether a particular one exists. Look at the various man pages for further help.
 
Share this answer
 
Comments
soeun tony 10-Oct-11 11:34am    
Thanks for your reply
Could you tell me the sample?
let me sorry for this but i really want to know about it.
Thanks
Richard MacCutchan 10-Oct-11 12:33pm    
You can find plenty of samples of awk scripts here. Similar Google searches will find you samples for other commands. Without knowing exactly what you are trying to achieve it is difficult to suggest anything more.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900