- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cut, sed and awk - edit /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
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
10-31-2002 12:43 AM
10-31-2002 12:43 AM
cut, sed and awk - edit /etc/group
users::20:user1,users2 .. user130
to the following format
users::20:user1,user2... user65
users::20:user66,useruser67 .. user130
Thanks
Aravind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2002 01:24 AM
10-31-2002 01:24 AM
Re: cut, sed and awk - edit /etc/group
you can separate the line with
sed 's/user65,/user65\^Jusers::20:/g' /etc/group
Attention: you can not copy and paste this line because the ^J is a "Cntrl-V Cntrl-J"
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2002 02:54 AM
10-31-2002 02:54 AM
Re: cut, sed and awk - edit /etc/group
awk 'sub("user65,","user65\nuserA::20:")' file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2002 04:06 AM
10-31-2002 04:06 AM
Re: cut, sed and awk - edit /etc/group
try the attached script, using /etc/group as $1. If it does not work, please post a few lines of your input as attachment.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2002 05:39 AM
10-31-2002 05:39 AM
Re: cut, sed and awk - edit /etc/group
Try the attached perl program.
It will create a new group file without CLOBBERING the original, it's up to you to move them around (icd /etc;mv group orig_group;mv newgroup group)
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2002 06:10 AM
10-31-2002 06:10 AM
Re: cut, sed and awk - edit /etc/group
Attached you will find a script I wrote for the same purpose a while ago. It creates N-many '/tmp/group20.N' files each of up to 200 accounts by reading '/etc/passwd' and collecting all accounts belonging to group-20.
Run the script. Then edit '/etc/group' to remove the original group-20 specifications and insert the N-many '/tmp/group20.N' files created.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2002 01:34 PM
10-31-2002 01:34 PM