From owner-freebsd-questions@FreeBSD.ORG Sat Mar 2 23:29:16 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CEBB1E88 for ; Sat, 2 Mar 2013 23:29:16 +0000 (UTC) (envelope-from doug@safeport.com) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by mx1.freebsd.org (Postfix) with ESMTP id 78C7D926 for ; Sat, 2 Mar 2013 23:29:16 +0000 (UTC) Received: from fledge.watson.org (localhost.watson.org [127.0.0.1]) by fledge.watson.org (8.14.5/8.14.5) with ESMTP id r22MxMI4010364 for ; Sat, 2 Mar 2013 17:59:22 -0500 (EST) (envelope-from doug@safeport.com) Received: from localhost (doug@localhost) by fledge.watson.org (8.14.5/8.14.5/Submit) with ESMTP id r22MxMc5010361 for ; Sat, 2 Mar 2013 17:59:22 -0500 (EST) (envelope-from doug@safeport.com) X-Authentication-Warning: fledge.watson.org: doug owned process doing -bs Date: Sat, 2 Mar 2013 17:59:22 -0500 (EST) From: doug@safeport.com X-X-Sender: doug@fledge.watson.org To: "freebsd-questions@FreeBSD.org" Subject: Re: rm -R In-Reply-To: Message-ID: References: <51321FAE.2010803@webrz.net> <13CA24D6AB415D428143D44749F57D7201EBE870@ltcfiswmsgmb21> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (fledge.watson.org [127.0.0.1]); Sat, 02 Mar 2013 17:59:22 -0500 (EST) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: doug@fledge.watson.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2013 23:29:16 -0000 On Sat, 2 Mar 2013, David Tilbrook wrote: > Wjy are we syill having this conversation? > The problem (and its solution) have been > raised for at least 39 years. > > To specify a file, directory, device, whatever, > whose leaf name begins with a `-', name it using > a leading `./' as in: > > whatever ./-S > > That will work for all programs, even those that > do not support -- to terminate flags. > > Furthermore it will support glob patterns. > > Now was that so difficult? > > -- dt Also find -type [df] -name "string" | xargs command find is pretty good about finding names with special characters and they get passed though xargs ok. This does not work with names with spaces of course. Also pretty easy to test at each step to make sure you are doing want you intend.