From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 12 23:18:02 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF9A38A9 for ; Thu, 12 Mar 2015 23:18:02 +0000 (UTC) Received: from slim.berklix.org (slim.berklix.org [94.185.90.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E540A72 for ; Thu, 12 Mar 2015 23:18:01 +0000 (UTC) Received: from mart.js.berklix.net (p5DCBE7D2.dip0.t-ipconnect.de [93.203.231.210]) (authenticated bits=128) by slim.berklix.org (8.14.5/8.14.5) with ESMTP id t2CNLZx9087184; Fri, 13 Mar 2015 00:21:36 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id t2CNHiQR035531; Fri, 13 Mar 2015 00:17:44 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id t2CNHJtI056445; Fri, 13 Mar 2015 00:17:32 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <201503122317.t2CNHJtI056445@fire.js.berklix.net> To: "Chris H" Subject: Re: find with -delete option on absolute paths From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultants, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Thu, 12 Mar 2015 12:09:21 -0700." <3b90cd87b96ea11ed03d5125a897949e@ultimatedns.net> Date: Fri, 13 Mar 2015 00:17:19 +0100 Cc: Matt Tagg , freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Mar 2015 23:18:03 -0000 "Chris H" wrote: > On Thu, 12 Mar 2015 18:54:38 +0100 "Julian H. Stacey" 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.