- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: entering 3000 lines in vi editor
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
тАО09-15-2009 02:55 PM
тАО09-15-2009 02:55 PM
i have to add 3000 users in a group as a secondary group. when i am doing vi and try to save the file after entering these users against their group. it gives an error:-
line too long
Please help on this as how can i enter my users in the group file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 03:16 PM
тАО09-15-2009 03:16 PM
SolutionThis must be an early (< 11.0) release.
You have reached 'vi' limits or for that matter the system's LINE_MAX.
There is nothing to prevent you from declaring the same group multiple times with differing lists of users where the whole line remains in limits.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 03:20 PM
тАО09-15-2009 03:20 PM
Re: entering 3000 lines in vi editor
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=959497
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 03:23 PM
тАО09-15-2009 03:23 PM
Re: entering 3000 lines in vi editor
and when i do with one group and all users, it gives "Line too long" error.
i am able to enter groups by having same GID, but different groupname...but it does not solve my purpose.
Any parameter, command or environment variable, i have to edit to do this.
Please suggest..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 07:15 PM
тАО09-15-2009 07:15 PM
Re: entering 3000 lines in vi editor
So why don't you do something convenient for yourself, like EXCEL or a VI for shorter lines and then use a tool like AWK or PERL or a script to glue it together. We have computers to help no?!
If you used a convention of potentially repeated group name in column 1 followed by a list of user then you could use something like:
$ cat tmp.txt
aap one two three
aap een twee drie
noot four
mies five six seven
mies vijf zes zeven
mies cinque six sept
$ perl -ne 'chomp; m/(\S+)(\s+\S.*)/;if ($1 ne $x) {print qq($x $y\n) if $x; $x=$1; $y=$2}
.=$2}; print "$x $y$2" if eof' tmp.txt
aap one two three een twee drie
noot four
mies five six seven vijf zes zeven cinque six sept cinque six sept
BYu can use any format you like.
Like "--- name" to start a fresh group, and the users 'naked' on the next lines.
But where do those names come from? Surely from some computer output? How about using that form input?
hth.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 09:10 PM
тАО09-15-2009 09:10 PM
Re: entering 3000 lines in vi editor
If you are not able to open your passwd file into vi then do one think ftp your passwd file into your desktop open in excel and add secondry group save as the file as suppose npasswd.csv
now open your npasswd.csv file into a notepad find and replace all , with ; and save it
put again into /tmp/npasswd.csb
make a cp of your passwd file
cp /etc/passwd /etc/passwd.today's date
then mv /tmp/npasswd.csv /etc/passwd
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2009 03:37 AM
тАО09-16-2009 03:37 AM
Re: entering 3000 lines in vi editor
You can use vim instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2009 03:52 AM
тАО09-16-2009 03:52 AM
Re: entering 3000 lines in vi editor
you could, but, IIRC, you still run into issues with the max length of a line in the group file itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2009 03:25 AM
тАО09-22-2009 03:25 AM
Re: entering 3000 lines in vi editor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-22-2009 03:37 AM
тАО09-22-2009 03:37 AM
Re: entering 3000 lines in vi editor
>>try vipw command , its exclusively for passwd file
insted of giving vi /etc/passwd, vipw is for edit /etc/passwd into vi editor no need to give /etc/passwd again.
just give vipw it will open your /etc/passwd file.
Suraj