Shell - argv limits

Mark Wieder ahsoftware at sonic.net
Wed Jun 28 19:45:50 EDT 2017


On 06/28/2017 04:06 PM, JB via use-livecode wrote:
> When using argv it has a character limit.  I think it
> might be different on different systems but you can
> probably use a few thousand characters for each
> argument.  You can have as many arguments as
> memory can handle.  Probably thousands.  You
> should refer to a file for larger data.

It does indeed depend on the OS, but I think the maximum length is for 
the total command line, not for individual arguments. At any rate, for 
my linux mint system I see an ARG_MAX value of 2097152.

https://stackoverflow.com/questions/6846263/maximum-length-of-command-line-argument-that-can-be-passed-to-sqlplus-from-lin

Note that there is also a limit to the number of arguments that can be 
passed on a commandline, and as a rule of thumb it is *probably* 
ARG_MAX/4-1, but if this is something that concerns you, you no doubt 
have other things to worry about <g>.

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list