Steve Langasek: SL> On Sun, Jan 20, 2008 at 03:17:35PM +0000, River Tarnell wrote: >> i'm not sure what's causing this, but the use of xargs seems pointless >> anyway; 'find -exec rm {};' should work without the possibility of >> producing this error.
SL> No. -exec spawns a separate subprocess for each file, and cannot handle SL> embedded spaces in filenames; it is to be avoided for non-trivial uses. -exec has no problem with spaces in filenames: [EMAIL PROTECTED]:~/ftest>touch 'one two three' 'four five six' [EMAIL PROTECTED]:~/ftest>find . -type f -exec ls -l {} \; -rw-r--r-- 1 river users 0 2008-01-27 07:42 ./one two three -rw-r--r-- 1 river users 0 2008-01-27 07:42 ./four five six [EMAIL PROTECTED]:~/ftest> it only executes one process per command if you use the ';' form. '-exec rm {} +' would work the same way as xargs. unfortunately, when i tested that it also produced the same error :) i see GNU find has a '-delete' extension, which would seem to be even better suited to this particular case (assuming this script isn't also required to work on non-GNU systems). SL> The only way you could get this error message is if the combined number of SL> bytes in the environment and argument list exceeded the kernel maximum. Per SL> the xargs manpage, by default the arguments are batched in groups of 131072 SL> bytes. Do you have an extraordinarily large number of environment SL> variables? If so, we might be able to fix this bug by using 'env'; SL> otherwise, I can't see any way that this bug would occur with a normal SL> kernel. I manually deleted the old sessions (because it was producing the error every half an hour), so I'm not sure how many files there were. cron was started by me after sudo'ing, so it has my environment: PATH=/opt/intel/idb/10.0.023/bin:/opt/intel/cc/10.0.023/bin:/sbin:/usr/sbin:/bin:/usr/bin:/opt/sun/sunstudio12/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin MAIL=/var/mail/river TERM=xterm LANG=en_US.ISO-8859-15 HOME=/home/river SHELL=/usr/bin/zsh LOGNAME=root USER=root USERNAME=root SUDO_COMMAND=/usr/bin/zsh SUDO_USER=river SUDO_UID=1072 SUDO_GID=100 SHLVL=1 PWD=/home/river/ftest OLDPWD=/home/river/ftest CVS_RSH=ssh EDITOR=vim NNTPSERVER=news.gmane.org FTP_PASSIVE=yes LESS=-egiJMRw -z-3 DMAKE_MAX_JOBS=2 DMAKE_MODE=parallel MANPATH=/opt/intel/idb/10.0.023/man:/opt/intel/cc/10.0.023/man:/usr/share/man:/usr/local/man LD_LIBRARY_PATH=/opt/intel/cc/10.0.023/lib DYLD_LIBRARY_PATH=/opt/intel/cc/10.0.023/lib INTEL_LICENSE_FILE=/opt/intel/cc/10.0.023/licenses:/opt/intel/licenses:/home/river/intel/licenses:/Users/Shared/Library/Application Support/Intel/Licenses _=/usr/bin/env i'll see if i can make xargs do the same thing in a controlled test... - river.
pgp3LWKRGY0Pn.pgp
Description: PGP signature