Operating System - HP-UX
1830931 Members
2111 Online
110017 Solutions
New Discussion

Max limit of characters in a line???

 
Purusa
Frequent Advisor

Max limit of characters in a line???

Hi,

I have one problem. I am not able to enter more than 2048 characters in a single line in a file. This file contains the users I have for my network. Since one line atmost can have 2048 characters I am not able to create more than a certain number of users. Can I somehow increase this limit of max characters in a line? Is there any workaround??

Regards,
Pankaj
A deep chasm can't be crossed in two steps
5 REPLIES 5
T G Manikandan
Honored Contributor

Re: Max limit of characters in a line???

get vim from

http://hpux.connect.org.uk/hppd/hpux/Editors/vim-6.2/


check for its dependencies.

This should resolve the case.
Sundar_7
Honored Contributor

Re: Max limit of characters in a line???

Hi Pankaj,

You can insert a backslash (\) at the end of the line and continue typing in the next line.

Sundar
Learn What to do ,How to do and more importantly When to do ?
Elmar P. Kolkman
Honored Contributor

Re: Max limit of characters in a line???

Or use the cpp to create the line you need. Just create lines with #define for user groups and then put all those groups next to each other on a single line, like this:

#define NWGUYS john jim tim
#define UXGUYS peter michael
#define UXGIRLS suzy
UXGIRLS UXGUYS NWGUYS

If you throw this at cpp, the output would become:
suzy peter michael john jim tim

This works of course without the cpp too, by using shell variables.

The solution totally depends on how the file is being read and such... So more info might help us give a more explicit answer.
Every problem has at least one solution. Only some solutions are harder to find.
KapilRaj
Honored Contributor

Re: Max limit of characters in a line???

You can have a file with more than 2048 characters but to view it you will need vim !!

Regds,

Kaps
Nothing is impossible
Mark Grant
Honored Contributor

Re: Max limit of characters in a line???

There is no limit on the number of characters on a line within a file. However, various tools that might be used to read this file, such as "vi" or some shell commands do have a limit.

if you create a file with

/usr/bin/echo "user1 user2 user3\c" >> file

The "\c" will stop "echo "putting a newline at the end. You can threfore keep doing that all day long and the file will get bigger and bigger and you will have a huge file of one line. "vi" probably won't be able to view it though.

So, it depends how you read this file. "cat" will probably work as will

perl -ne "print" filename
Never preceed any demonstration with anything more predictive than "watch this"