Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bash Argument list too long 1

Status
Not open for further replies.

stefanwagner

Programmer
Oct 19, 2003
2,373
DE
When I call:
jar -cf ../blues.jar *
on bash, I get:
jar: Argument list too long

If I start an equivalent zip-command, I get
gzip: Argument list too long

I guess it is the bash, which tries to generate the list of all the files (about 42.000) and gets confused by to much files.
Is the limit of file-expansion a well-known bash-item?
Does it depend on the filename-length?

 
I think bash limits arguments to 32,768 characters

What you can do is:

[tt]jar -cf ../blues.jar .[/tt]

That will recursively add the current directory to the jar archive.


I REALLY hope that helps.
Will
 
Hey!
Thanks for that hint!

I will try it out at home this evening, since I'm punished to work with silly2000 at work, and can't try it out here.

I hope I will remember to post my experiences here.
Maybe someone else can take advantage of that too.

----
Don't visit my homepage at:
<a href='
 
So now I'm at home and gave it a try.
Though it lasted about 20 minutes to jar 40.000 Files to a 28MB jar file, the command
jar -cf ../blues.jar .
worked, and making the index
cd ..
jar -i blues.jar
needed 9 Minutes, but it succeeded, and that was the point.

Every solution should be that lean :)

Thanks,
Stefan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top