LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linux command line arguments (https://www.linuxquestions.org/questions/programming-9/linux-command-line-arguments-480366/)

kd5pbo 09-04-2006 03:15 PM

Linux command line arguments
 
Is there a way to increase the number of command line arguments that can be passed to a program. Ideally, I'd like to be able to pass any arbitrary number of aruments, but in practise, 20,000 or so is what I need.

Tinkster 09-04-2006 03:24 PM

That would be a very uncommon usage. Usually people would start using xargs
or something in that scenario. What are you trying to do?


Cheers,
Tink

unSpawn 09-04-2006 04:37 PM

Your systems maximum is $(getconf ARG_MAX)*. I agree 20K args in one go is not part of any realistic solution, regardless of the problem. You prolly need some preprocessing done.

randyding 09-04-2006 08:30 PM

Hi,
kd5pbo, when you run that getconf ARG_MAX call you'll get 131072 and thats bytes max for all aguments plus environment, its not actual number of arguments you can pass directly.

In practice people solve this type of problem by passing the name of a configuration file on the command line and the program opens this file for reading to get the 20000 or so lines of data.

Edit: or pass it to the program on stdin


All times are GMT -5. The time now is 08:16 AM.