Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-04-2006, 03:15 PM   #1
Registered: Jun 2006
Location: Washington, DC, USA
Distribution: Slackware
Posts: 41

Rep: Reputation: 15
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.
Old 09-04-2006, 03:24 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Old 09-04-2006, 04:37 PM   #3
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
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.
Old 09-04-2006, 08:30 PM   #4
Registered: May 2004
Posts: 552

Rep: Reputation: 31
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

Last edited by randyding; 09-04-2006 at 08:31 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase command line Arguments Size in UNIX/LINUX??? sunilvadranapu General 10 03-31-2009 11:47 AM
command line arguments nickraj Programming 6 09-11-2006 01:01 PM
command line arguments containing ( Lotharster Linux - Newbie 3 01-05-2006 08:43 AM
Awk command-line arguments lowpro2k3 Programming 1 03-28-2005 09:09 PM
Help with command line arguments ? synapse Linux - Newbie 2 02-23-2004 02:25 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration