List Info

Thread: Re: CVS commit: src/usr.bin/find




Re: CVS commit: src/usr.bin/find
country flaguser name
United States
2007-02-12 01:03:16
der Mouse wrote:
>>In this case passing an open file won't help, as it
is the directory
>>entry (ie the name) that has to be removed, not the
open file.
> 
> 
> Passing an open file will indeed help, provided it's
done right: pass a
> fd on the directory along with the name.  Then rm can
fchdir() to the
> directory and unlink() the name, safely.

Another option would be:

find . -name '*.bak' -exec-in-dir rm -f -- {} ;

Roland

Re: CVS commit: src/usr.bin/find
country flaguser name
South Africa
2007-02-12 02:02:40
On Mon, 12 Feb 2007, Roland Illig wrote:
> Another option would be:
> 
> find . -name '*.bak' -exec-in-dir rm -f -- {} ;

find(1) already has a "-execdir" primary.

--apb (Alan Barrett)

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )