Operating System - HP-UX
1838604 Members
3507 Online
110128 Solutions
New Discussion

Re: How to increase ARG_MAX or disable the limit in HP-UX 11.23 IA64

 
Eric Sun
Occasional Contributor

How to increase ARG_MAX or disable the limit in HP-UX 11.23 IA64

I am processing large a mount of files in 11.23, but the current ARG_MAX is 2048000, therefore I ran into "ksh: /usr/bin/ls: arg list too long" problem a lot.

I am wondering if there is a way to tune the kernerl paramter to increase the total length of the arguments for exec() in bytes, including environment data.

Or if there is a way to disable the limit of ARG_MAX?

Your advice is greatly appreciated.

E.S.

HP-UX hp14 B.11.23 U ia64
4 REPLIES 4
Eric Sun
Occasional Contributor

Re: How to increase ARG_MAX or disable the limit in HP-UX 11.23 IA64

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=765004

large_ncargs_enabled

I did not see this parameter in 11.23 either.
Doug O'Leary
Honored Contributor

Re: How to increase ARG_MAX or disable the limit in HP-UX 11.23 IA64

Hey;

You don't really give enough info to help out. What are you trying to do with all the files? Is the list of files generated from another command?

One place people commonly run into this is via the find command. To circumvent that, you can:

find ${args} -print | xargs -i ${cmd} {}

If you're doing a straigh ls, loop through it:

ls | while read file
do
# whatever I want
done

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Doug O'Leary
Honored Contributor

Re: How to increase ARG_MAX or disable the limit in HP-UX 11.23 IA64

Oh, sorry; my bad. To straight answer your question, no, to my knowledge, there is no way to modify the maximum argument length...

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Eric Sun
Occasional Contributor

Re: How to increase ARG_MAX or disable the limit in HP-UX 11.23 IA64

Thanks. I will change my script to incorporate the xargs().