out of curiosity

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Buettner
Date:  
Subject: out of curiosity
On Jul 9, 11:56pm, Jonathan Furrer wrote:

> Is there any limit to the number of sub lines i.e.:
>
> command \
> arg1 \
> arg2
>
> that one can use? Assuming this is shell dependant, lets say in bash


I think the limit is going to be influenced by one of _POSIX_ARG_MAX
or the value returned by sysconf(_SC_ARG_MAX). The former is the
minimum value that a posix compliant system must support and the
latter is the actual value on the system in question. In either
case, the constant _POSIX_ARG_MAX or the value returned from calling
sysconf(_SC_ARG_MAX) represents the "maximum length of arguments to
execve including environment". (From <bits/posix1_lim.h>.)

On my RH 6.2 system, _POSIX_ARG_MAX is defined to be 4096 (in
/usr/include/bits/posix1_lim.h). The value returned by
sysconf(_SC_ARG_MAX) is 131072.

So, I would think the maximum number of continuation lines would be

    sysconf(_SC_ARG_MAX) - number of environment pairs


Kevin