1833007 Members
2682 Online
110048 Solutions
New Discussion

Parameter list too Long

 
KapilRaj
Honored Contributor

Parameter list too Long

Is there a limit to the Number of Exported variables in a shell ?.

kaps
Nothing is impossible
6 REPLIES 6
Stefan Farrelly
Honored Contributor

Re: Parameter list too Long

I dont think there is a limit but the error "Parameter list too long" is usually because you have too many arguments on a single command line. Piping it through xargs fixes it.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Steve Steel
Honored Contributor

Re: Parameter list too Long

Hi


depends on the OS version.

which are you using.

see

http://bizforums.itrc.hp.com/cm/QuestionAnswer/1,,0x9e5fc1c4ceddd61190050090279cd0f9,00.html

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Balaji N
Honored Contributor

Re: Parameter list too Long

no, i dont think there is a limit for the no of exported variables in a shell.


but your problem, seems like u are exceeding the maximum length of the command line argument passed on a shell.

hth
-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
KapilRaj
Honored Contributor

Re: Parameter list too Long

Will try and get back to you.

kaps
Nothing is impossible
Mike Stroyan
Honored Contributor

Re: Parameter list too Long

The system limits the total bytes of data for environment and arguments. Individual shells and other programs may have their own limits on how many environment variables they can handle.

From "man sysconf"
ARG_MAX _SC_ARG_MAX
Maximum total length of the arguments for exec() in bytes, including environment data (see exec(2))

From "man exec"
If exec*() fails and returns to the calling program,
errno is set to one of the following values:

[E2BIG]
The number of bytes in the new program's
argument list plus environment is greater
than the system-imposed limit. This limit is
at least 5120 bytes on HP-UX systems.

The limit on 11.00 and on patched 10.20 is 2000K bytes.
James A. Donovan
Honored Contributor

Re: Parameter list too Long

Following may be of some use: from /usr/include/limits.h on 11.0

#if defined(_INCLUDE_POSIX_SOURCE) || defined(_INCLUDE_POSIX2_SOURCE)
# define _POSIX_ARG_MAX 4096 /* The length of the arguments for
one of the exec functions in bytes,
including environment data. */

also...

# if defined(_XPG2) || defined(_SVID3) || defined(_XPG4_EXTENDED)
/*
* The following limits are not actually invariant, but are configurable.
* The correct values can be determined using the sysconf() function.
* The default values are provided here because the constants are specified
* by several publications including XPG (X/Open Portability Guide) Issue 2
* and SVID (System V Interface Definition) Issue 2.
*/
# define ARG_MAX 2048000 /* Maximum length of arguments for the
exec function in bytes, including
environment data */
Remember, wherever you go, there you are...