On Sat, Apr 09, 2005 at 08:53:52AM -0700, Steve Langasek wrote:
> On Sat, Apr 09, 2005 at 12:21:36PM +0200, Tom Albers wrote:
> > 
> > My co-worker used it to store some old fonts in there. I do not know why, 
> > but 
> > it gave serious trouble upgrading debian ;-)
> > 
> > > the find command returns the full path 
> > > to each file it finds: there's no way that a path anchored at the root
> > > directory is going to begin with a -, it will always begin with a slash.
> > > What's the actual path of the file causing problems for you, and what is
> > > the error you get?
> 
> > testcase:
> > cd /tmp
> > mkdir -- "- oldones -"
> > cd -- -\ oldones\ -/
> > touch temp
> > cd ..
> 
> > command: "find . -name temp | xargs rm -f" will result in an error that 
> > this 
> > option is not supported by rm. "find . -name temp | xargs rm -f --" works 
> > fine. 
> 
> Well, all you've done in this case is hidden the error; the rm -f *still*
> doesn't work correctly, because the paths being passed to rm -f are now
> "./-", "oldones", and "-/temp", none of which are valid paths.  I don't
> think this workaround is a good idea; it's *only* needed in cases where you
> have a directory name with a space in it followed by a dash, and in such a
> case it will never result in successful deletion of the directory.  You
> might as well just stick "|| true" on the end of the line for all the
> difference it makes.
> 
> > I agree it will not happen for many people, but if it happens, you really 
> > don't know how to solve it, unless you debug the postinstall script. It is 
> > not theoretical, I ran into it yesterday and took me quite a bit to find 
> > the 
> > problem ;-)
> 
> Yeah, in such an edge case I'd rather see the admin deal with it manually
> rather than hiding the problem.  It was the admin's bright idea to create
> this directory name, he should be bright enough to figure out how to fix it
> ;)

Why not use find -print0 | xargs -0 as in

find /var/lib/defoma/x-ttcidfont-conf.d -name fonts.cache-1 -print0 \
    | xargs -0 rm -f

Cheers,
-- 
Bill. <[EMAIL PROTECTED]>

Imagine a large red swirl here. 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to