Date: Fri, 13 Mar 2015 00:17:19 +0100 From: "Julian H. Stacey" <jhs@berklix.com> To: "Chris H" <bsd-lists@bsdforge.com> Cc: Matt Tagg <wamatt@gmail.com>, freebsd-hackers@freebsd.org Subject: Re: find with -delete option on absolute paths Message-ID: <201503122317.t2CNHJtI056445@fire.js.berklix.net> In-Reply-To: Your message "Thu, 12 Mar 2015 12:09:21 -0700." <3b90cd87b96ea11ed03d5125a897949e@ultimatedns.net>
next in thread | previous in thread | raw e-mail | index | archive | help
"Chris H" wrote: > On Thu, 12 Mar 2015 18:54:38 +0100 "Julian H. Stacey" <jhs@berklix.com> wrote > > > Matt Tagg wrote: > > > Hey BSD folks > > > > > > I believe this was discussed previously (2013), though I could not > > > find a resolution. > > > > > > To recap, suppose we try deleting files on an absolute path: > > > > > > matt@mtbook:/% find /tmp/foo/* -delete > > > find: -delete: /tmp/foo/bar.txt: relative path potentially not safe > > > > > > As you can see it gives an error and quits. However if we instead try this: > > > > > > matt@mtbook:/% gfind /tmp/foo/* -delete > > > > > > GNU Find throws no error and works as expected ('bar.txt is deleted') > > > > > > So as an end user, I find this rather confusing. How can I get the > > > same behavior with BSD Find out of the box? > > > > Off on a tangent: > > Last millenia (1987 :-) when I was using find & needed an rm to reduce > > near duplicate trees on DOS & Unix, I wrote my own C > > http://berklix.com/~jhs/src/bsd/jhs/bin/public/cmpd/ > > I've never since worried about getting syntax of test conditions > > wrong & deleting good stuff by mistake. > Thanks for sharing that, Julian. :-) > I don't see an entry for this in the ports tree. :-/ > Thanks, again. > --Chris Hi Chris, Thanks :-) It's part of 8.5 meg of small tools & diffs in http://berklix.com/~jhs/src/ that I've occasionaly thought of rolling parts of for a port, but cd ~/public_html/src; make; make install works here, so I've never gone further, though ideally perhaps I should tidy & bundle some bits. Cheers, Julian -- Julian Stacey, BSD Linux Unix C Sys Eng Consultant Munich http://berklix.com Indent previous with "> ". Reply Below as a play script. Send plain text, Not quoted-printable, HTML, or base64.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503122317.t2CNHJtI056445>