On Tue, Dec 23, 2003 at 08:34:17AM +0900, Vincent Lefevre wrote: | On 2003-12-19 10:53:35 -0500, Derrick 'dman' Hudson wrote: | > On Fri, Dec 19, 2003 at 11:47:32AM +0200, Dobai-Pataky Balint wrote: | > | i have a webcam logging all motion into jpgs, my php code does lots with | > | it, except after i convert selected jpgs copied into the workin' folder, | > | and after conversion i'd like to rm them from php or by hand it'll give: | > | rm *.jpg | > | su: /bin/rm: Argument list too long | > | > The problem is that the shell has a hard limit on the size (in bytes) | > of commands. | | No, it's a kernel limit, not a shell limit. Ok. Close, though :-). | > Another option, not yet given, is : | > | > find . -name \*.jpg | xargs rm | | This is potentially dangerous (filenames may contain a \n character). True. Even just a space is a problem since xargs will think it separates two paths. | If you want to use find and xargs, do it correctly (see other posts). I agree, if you aren't positive your data is well-formed. When working on files I -know- don't contain spaces or other "odd" characters I often omit the -print0/-0. If I'm not positive, then i include them. -D -- "640K ought to be enough for anybody" -Bill Gates, 1981 www: http://dman13.dyndns.org/~dman/ jabber: dman@dman13.dyndns.org
Attachment:
pgpWIJ4hZDn4v.pgp
Description: PGP signature