1831294 Members
2939 Online
110022 Solutions
New Discussion

Re: awk byte limit

 
randy lee
Advisor

awk byte limit

I am receiving an error when a script runs using awk within it. It tells me the linit for awk of a string is 3000bytes. I installed the awk patch PHCO_27521, but it still occurs.
Are there any other patches needed ??
It is running hpux 11.00

Thanks
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: awk byte limit

That is the built-in record size limit for awk and is hard-coded. The answer is to install the Gnu version of awk - gawk. It's a superset of awk and will fix your problem.
http://gatekeep.cs.utah.edu/hppd/hpux/Gnu/gawk-3.1.1/
If it ain't broke, I can fix that.
Jose Mosquera
Honored Contributor

Re: awk byte limit

Hi,

The record length limit is 3000. One answer would be to download gawk from any of the HP-UX Porting Centre. Gawk has a dynamically allocated buffer and can be set to any desired size by a command line argument.

http://hpux.connect.org.uk/hppd/hpux/Gnu/gawk-3.1.1/

Rgds.
Ralph Grothe
Honored Contributor

Re: awk byte limit

maybe Perl would come as a remedy?

though not knowing the Perl innards I'd assume that you're only restricted by memory

(n.b. you can slurp up whole files in one string in Perl by just localizing the record input seperator $/ in a code block, see "perldoc perlvar")
Madness, thy name is system administration