[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: find did not work



On Tue, Oct 26, 2004 at 12:33:49AM +0200, corerix wrote:
> I have a problem with findutils_4.1.20-4 ,
> find and locate wont work .
> the problem existed till 2 weeks .
> so the wenn i try to compile a file i get following error
> find debian -type d | xargs rmdir -p --ignore-fail-on-non-empty
> rmdir: zu wenige Argumente
What does that mean ^ ?

It is much easier for people to help with problems if you set your
locale back to "C" before reporting bugs, given most of use don't
understand German (or whichever language that is).

based on an educated guess of what it means, I think it's a problem with
rmdir saying "Too many arguments", in which case you should limit the
number of arguments xargs passes to it, using the -n option.  maybe you
can do -n 10, or even -n 1 if rmdir only allows one dir at a time in
some cases.  Also if you have subdirs your command will get annoyed, in
this case:

 debian
 +-x
 +-y
 | +-bar
 +-z

since find will return x y y/bar z and if you rmdir y before y/bar it
will either fail or it will fail when it tries to remove the already
gone y/bar.

Adding -depth option to find will make it return x y/bar y z which will
work fine.  Also whoever wrote the code isn't doing things right.  They
should use find -depth with rmdir without -p, since the -p is only
useful because they didn't use -depth and were causing errors.

So add -depth to find, and remove -p from rmdir and it should make
sense.  Then add -n # to xargs if it is still complaining about the
number of arguments.

Len Sorensen



Reply to: