- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Strings the user 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
тАО03-23-2011 03:21 AM
тАО03-23-2011 03:21 AM
Our problem is when more then 500 user in one group, we are unable to see the that group user.
for example
group sb , actually this group have more than 500 user inside . but when i edit the group (/etc , vi group) cannot to see the user name . error like below . so i think we need to strings the group . we have tried command : strings group group.string . but still same .
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@
Any idea.
Regards,
Chui
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-23-2011 04:52 AM
тАО03-23-2011 04:52 AM
SolutionBefore:
users::20:blh,abc,def,xyz,aaa,bbb,ccc...really long...
After:
users::20:blh,abc,def,xyz
users::20:aaa,bbb,ccc
users::20:dddd,ee,ffff,ggg
users::20:qwer,asdf,zxcv
and so on. You can repeat the same group ID as many times as you want.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2011 01:17 AM
тАО03-25-2011 01:17 AM
Re: Strings the user group
Do you the command line on how to break up the IDs for the same group?
Regards,
Chui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2011 03:45 AM
тАО03-25-2011 03:45 AM
Re: Strings the user group
Try with attached script. Please check and customize three variables inside. From the placement where you run the script a new group.mod file will be created. Your original /etc/group file will be unchanged.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2011 05:57 AM
тАО03-25-2011 05:57 AM
Re: Strings the user group
Previous script have a bug, please try with this new one.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2011 06:07 AM
тАО03-25-2011 06:07 AM
Re: Strings the user group
Try this 'one liner':
perl -pe 'm /^(\w+::\d+:)/; $grp=$1; s/((,[^,]+){8})./$1\n$grp/g' < long > short
explanation:
-pe # loop over input and print after processing
m /^(\w+::\d+:)/; # match the group name and number
$grp=$1; # remember group name and number
s/((,[^,]+){7}),/$1\n$grp/g' # look for 7 groups of a comma followed by a series of non-commas, and followed by a comma
Replace those with a newline, the group and the itself.
hth,
Hein
notes...
To test this I used perl to generate some long lines:
$ perl -le 'print qq(aap::20:), join q(,),(1000..1070)' >> long
Personally I would probably use a some script, not a one-liner and add more control like SORTing the element.
while (<>) {
m /(\w+::\d+:)(.*)/;
$grp=$1;
@mem=sort split /,/,$2;
$tmp = $grp;
$m = 0;
for (@mem) {
print $tmp,$_;
$tmp = ( ++$m % 7) ? q(,) : qq(\n$grp);
}
print qq(\n);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-25-2011 03:32 PM
тАО03-25-2011 03:32 PM
Re: Strings the user group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2011 07:55 PM
тАО03-27-2011 07:55 PM
Re: Strings the user group
Do you the command line for vim?
Regards,
Chui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-27-2011 07:58 PM
тАО03-27-2011 07:58 PM
Re: Strings the user group
Sorry. Forgot to add a word? Do you have the command line for vim?
Regards,
Chui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-28-2011 01:41 AM
тАО03-28-2011 01:41 AM
Re: Strings the user group
vim is gnu tool which install under /usr/local
http://hpux.connect.org.uk/hppd/hpux/Editors/vim-7.3/
it is AFAIK also part of the Internet Express DVD
Unix operates with beer.