- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- parsing /etc/group
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
Discussions
Discussions
Forums
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
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
тАО07-30-2001 11:31 AM
тАО07-30-2001 11:31 AM
I have a system with 6000+ users where the /etc/group file has become unmanageable and needs to be parsed a bit so users can be manually added. I am having trouble trying to do so. Does anyone have some sed syntax that may assist with this task? As vi is running out of buffer room.
The specific group line is extremely long and is far above the 70 characters recommended. Just wondering how I should go about tending to this need? Thanks.
- Mike
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2001 12:20 PM
тАО07-30-2001 12:20 PM
SolutionI suspect if vi is having problems with buffer size then ed, sed, awk, etc will have also.
Perl can probably parse the file but I know you can download 'gawk' from
http://hpux.cs.utah.edu/hppd/hpux/Gnu/gawk-3.1.0/
The good news is that unlike awk, gawk has a dynamic buffer and can be as large as you set in the command line. It may work without it depending on just how big your line is.
Bear in mind, is is perfectly acceptable to have multiple group lines like this:
mygroup::45:user1,user2,user3
mygroup::45:user101,user102,user103
I had an awk script that was very close and should rewrite the file for you. It will split groups into no more than 50 users each.
Use it like this: cat /etc/group | awk (or gawk) -f split.awk > /tmp/newgroup
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2001 01:12 PM
тАО07-30-2001 01:12 PM
Re: parsing /etc/group
In /etc/group, it isn't necessary to include users in their primary group.
Each line in /etc/group is limited to LINE_MAX, as defined in
I've used the attached perl script to cleanup /etc/group on a few systems where user management was getting out of hand.
I've also trained my account administrators to use useradd, usermod, userdel, groupadd, groupmod, and groupdel while discouraging direct editing of the passwd and group files. All of the account management scripts have also been rewritten to use the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-30-2001 02:29 PM
тАО07-30-2001 02:29 PM
Re: parsing /etc/group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-31-2001 06:51 AM
тАО07-31-2001 06:51 AM
Re: parsing /etc/group
Your scripts work great, they both took care of my needs. I'll probably stick with using the perl script as I'm a big perl fan myself. Thanks for your time, it is appreciated greatly.
- Mike