Date: Sat, 2 Mar 2013 17:59:22 -0500 (EST) From: doug@safeport.com To: "freebsd-questions@FreeBSD.org" <freebsd-questions@freebsd.org> Subject: Re: rm -R Message-ID: <alpine.BSF.2.00.1303021755030.10788@fledge.watson.org> In-Reply-To: <CAAPNFHQLW7bDmWQ6UvLiSbk38F6h67EzXAfwfRLmQCijLTcBcg@mail.gmail.com> References: <51321FAE.2010803@webrz.net> <13CA24D6AB415D428143D44749F57D7201EBE870@ltcfiswmsgmb21> <CAAPNFHQLW7bDmWQ6UvLiSbk38F6h67EzXAfwfRLmQCijLTcBcg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <dir> -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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1303021755030.10788>