* Argument list
@ 2002-10-01 19:54 David Gómez
2002-10-01 20:14 ` Jason Price
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: David Gómez @ 2002-10-01 19:54 UTC (permalink / raw)
To: Zsh-workers
Hi all,
I created a directory with 100000 files to test the new htree patch for the
ext3 filesystem, and found a ¿bug? when I tried to remove all the files.
The command 'rm *' gave the error 'zsh: argument list too long'. If expansion
doesn't support so many parameters, what it's the supossed way to remove all
these files without deleting the directory?
thanks,
--
David Gómez
"The question of whether computers can think is just like the question of
whether submarines can swim." -- Edsger W. Dijkstra
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Argument list
2002-10-01 19:54 Argument list David Gómez
@ 2002-10-01 20:14 ` Jason Price
2002-10-01 20:20 ` Dan Nelson
2002-10-01 20:26 ` DervishD
2 siblings, 0 replies; 7+ messages in thread
From: Jason Price @ 2002-10-01 20:14 UTC (permalink / raw)
To: David Gómez; +Cc: Zsh-workers
"David Gómez" <david@pleyades.net> writes:
> I created a directory with 100000 files to test the new htree patch
> for the ext3 filesystem, and found a bug when I tried to remove all
> the files. The command 'rm *' gave the error 'zsh: argument list too
> long'. If expansion doesn't support so many parameters, what it's the
> supossed way to remove all these files without deleting the directory?
This is actually an OS limit rather than a zsh limit. IIRC, zsh
dynamically alocates space for arguments as needed. However, the OS
usually has a hard limit set somewhere.
ls | xargs rm
though there's probably a cleaner way. Season the 'ls' command to
taste.
Jason
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Argument list
2002-10-01 19:54 Argument list David Gómez
2002-10-01 20:14 ` Jason Price
@ 2002-10-01 20:20 ` Dan Nelson
2002-10-01 21:07 ` David Gómez
2002-10-01 20:26 ` DervishD
2 siblings, 1 reply; 7+ messages in thread
From: Dan Nelson @ 2002-10-01 20:20 UTC (permalink / raw)
To: David G≤mez; +Cc: Zsh-workers
In the last episode (Oct 01), David Gmez said:
> I created a directory with 100000 files to test the new htree patch
> for the ext3 filesystem, and found a ¿bug? when I tried to remove all
> the files. The command 'rm *' gave the error 'zsh: argument list too
> long'. If expansion doesn't support so many parameters, what it's the
> supossed way to remove all these files without deleting the
> directory?
You sure the error wasn't 'zsh: argument list too long: rm' ?
internal shell wildcard expansion has no argument limit. execve()
does. Either raise your kernel's limit (sorry; don't know how to do it
on Linux), or use "echo * | xargs rm", and let xargs split the argument
list up.
--
Dan Nelson
dnelson@allantgroup.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Argument list
2002-10-01 20:20 ` Dan Nelson
@ 2002-10-01 21:07 ` David Gómez
2002-10-02 8:08 ` Thomas Köhler
0 siblings, 1 reply; 7+ messages in thread
From: David Gómez @ 2002-10-01 21:07 UTC (permalink / raw)
To: Dan Nelson; +Cc: Zsh-workers
> > I created a directory with 100000 files to test the new htree patch
> > for the ext3 filesystem, and found a ¿bug? when I tried to remove all
> > the files. The command 'rm *' gave the error 'zsh: argument list too
> > long'. If expansion doesn't support so many parameters, what it's the
> > supossed way to remove all these files without deleting the
> > directory?
>
> You sure the error wasn't 'zsh: argument list too long: rm' ?
You're right, that was the full error line. I didn't put the rm because
i thought it wasn't important, my fault.
> internal shell wildcard expansion has no argument limit. execve()
> does. Either raise your kernel's limit (sorry; don't know how to do it
> on Linux),
I've been trying to raise some limits, but none of them affect the number of
parameters execve() supports, maybe is possible to change it in linux through
some /proc variable, or a kernel recompilation is needed.
I just wanted to know if this was a zsh related problem, now i'll look forward
to know how to change execve limits.
Thanks to all the replies ;),
--
David Gómez
"The question of whether computers can think is just like the question of
whether submarines can swim." -- Edsger W. Dijkstra
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Argument list
2002-10-01 21:07 ` David Gómez
@ 2002-10-02 8:08 ` Thomas Köhler
2002-10-02 9:40 ` David Gómez
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Köhler @ 2002-10-02 8:08 UTC (permalink / raw)
To: David Gómez; +Cc: Zsh-workers
[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]
David Gómez wrote [2002/10/02 09:12]:
>
> > > I created a directory with 100000 files to test the new htree patch
> > > for the ext3 filesystem, and found a ¿bug? when I tried to remove all
> > > the files. The command 'rm *' gave the error 'zsh: argument list too
> > > long'. If expansion doesn't support so many parameters, what it's the
> > > supossed way to remove all these files without deleting the
> > > directory?
> >
> > You sure the error wasn't 'zsh: argument list too long: rm' ?
>
> You're right, that was the full error line. I didn't put the rm because
> i thought it wasn't important, my fault.
>
> > internal shell wildcard expansion has no argument limit. execve()
> > does. Either raise your kernel's limit (sorry; don't know how to do it
> > on Linux),
>
> I've been trying to raise some limits, but none of them affect the number of
> parameters execve() supports, maybe is possible to change it in linux through
> some /proc variable, or a kernel recompilation is needed.
>
> I just wanted to know if this was a zsh related problem, now i'll look forward
> to know how to change execve limits.
/usr/src/linux/include/linux> grep ARG_MAX limits.h
#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
Hopefully, changing this value and recompiling your kernel will help...
Ciao,
Thomas
--
Thomas Köhler Email: jean-luc@picard.franken.de | LCARS - Linux
<>< WWW: http://jeanluc-picard.de | for Computers
IRC: jeanluc | on All Real
PGP public key available from Homepage! | Starships
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Argument list
2002-10-02 8:08 ` Thomas Köhler
@ 2002-10-02 9:40 ` David Gómez
0 siblings, 0 replies; 7+ messages in thread
From: David Gómez @ 2002-10-02 9:40 UTC (permalink / raw)
To: Thomas Köhler; +Cc: Zsh-workers
> /usr/src/linux/include/linux> grep ARG_MAX limits.h
> #define ARG_MAX 131072 /* # bytes of args + environ for exec() */
>
> Hopefully, changing this value and recompiling your kernel will help...
Thanks! ;). I'll change it and test a new kernel
--
David Gómez
"The question of whether computers can think is just like the question of
whether submarines can swim." -- Edsger W. Dijkstra
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Argument list
2002-10-01 19:54 Argument list David Gómez
2002-10-01 20:14 ` Jason Price
2002-10-01 20:20 ` Dan Nelson
@ 2002-10-01 20:26 ` DervishD
2 siblings, 0 replies; 7+ messages in thread
From: DervishD @ 2002-10-01 20:26 UTC (permalink / raw)
To: David Gómez; +Cc: Zsh-workers
Hi David :)
> The command 'rm *' gave the error 'zsh: argument list too long'.
Obvious ;) That's a good bunch of files to delete ;))
> If expansion doesn't support so many parameters,
I'm not quite sure, but I think you can raise the limit on
argument list length :????
> what it's the supossed way to remove all
> these files without deleting the directory?
The easier is find+xargs. 'find' will feed the filenames
(-print0 is your friend here if you have 'strange' names) to xargs,
which will process them a handful at a time.
Of course, I may miss some point here, I'm not a Zsh gurú.
Raúl
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-10-02 9:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-01 19:54 Argument list David Gómez
2002-10-01 20:14 ` Jason Price
2002-10-01 20:20 ` Dan Nelson
2002-10-01 21:07 ` David Gómez
2002-10-02 8:08 ` Thomas Köhler
2002-10-02 9:40 ` David Gómez
2002-10-01 20:26 ` DervishD
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).