Argument list too long.

Mike A. Harris mharris at redhat.com
Sat Sep 13 08:12:25 UTC 2003


On Thu, 11 Sep 2003, Sean Estabrooks wrote:

>> > >I'm not in favor to increase it to 64 per se, but at least something 
>> > >higher than 32 (as I've already come across this boundary at several 
>> > >occassions where the only solution was to work around it in a bad way).
>> > 
>> > man xargs
>> 
>> Seems plausible but unpractical in some situations. Eg. you're resigning
>> thousands of files, too long for the argument list. Doing it one by one 
>> would force you to enter your passphrase a thousand times.
>> 
>> You could split it up like the document says, but even that will make it 
>> harder (there's no guarantee that [a-n] will not be too long). Or you 
>> could starting to write an expect script that enters your passphrase... 
>> Sure.
>> 
>> But the easiest solution IMO would be to increase the size so that it 
>> doesn't occur that often in practice.
>> 
>
>Dag,
>
>  You just don't hear many people complaining about this as a 
>problem.  xargs allows you to combine the maximum number of 
>arguments per invocation of the command (-s option).   This limit 
>isn't reached very often in practice, and no matter what value you 
>pick someone will find a command that exceeds the limit.  
>
>   It usually doesn't take much effort to organize things so that this 
>just isn't an issue.   Perhaps if you posted a real script where you
>are having problems, suggestions could be made on alternative 
>methods.

That's really basically the bottom line.  The number of cases in 
which xargs is even needed is pretty small, and the number of 
cases in which there are other problems due to this is also very 
small.  The number of problems that would be created by 
increasing the commandline size is much larger in scope than the 
number of problems that would be solved by it, and it still would 
not solve the problem unless the commandline was made infinite in 
length.

A proper solution in the case of rpm signing of files, would be 
to use a file list stored in a text file instead of the 
commandline.  If rpm does not already allow filenames to be read 
from a file for gpg signing, and this was indeed a _real_ problem 
for someone (not just hypothetical), I'm sure jbj would accept a 
patch to rpm to allow it to read from a file the names of all 
packages needing signing.

Other software likely would too (if it doesn't already).  There's 
almost always more than one way to skin a cat, and when there 
isn't, may the source be with you.


-- 
Mike A. Harris     ftp://people.redhat.com/mharris
OS Systems Engineer - XFree86 maintainer - Red Hat





More information about the fedora-devel-list mailing list