From owner-freebsd-questions Fri Dec 1 16: 0:36 2000 Delivered-To: freebsd-questions@freebsd.org Received: from cheshire.manunkind.org (cheshire.manunkind.org [216.254.114.213]) by hub.freebsd.org (Postfix) with ESMTP id B9E0037B401 for ; Fri, 1 Dec 2000 16:00:33 -0800 (PST) Received: (from ryan@localhost) by cheshire.manunkind.org (8.11.1/8.11.1) id eB203aw35705; Fri, 1 Dec 2000 19:03:36 -0500 (EST) (envelope-from ryan) Date: Fri, 1 Dec 2000 19:03:35 -0500 From: Ryan Younce To: Joe Oliveiro Cc: Mike Meyer , Larry Rosenman , Daniel.Bye@uk.uu.net, questions@FreeBSD.ORG Subject: Re: Pesky file Message-ID: <20001201190335.A35590@cheshire.manunkind.org> References: <14888.4617.148599.530943@guru.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from joe@advancewebhosting.com on Fri, Dec 01, 2000 at 05:03:22PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Thus spake Joe Oliveiro : > rm -rf "-help" > > will remove the file There's one reason why that will not work, and that is because "-help" (without the quotes) will be passed to rm as argv[2], and the getopt() calls within rm will parse it just as they would any other option string. It would work, however, if, say, the file was named "foo*bar?", where shell metacharacter substitutions stand the possibility of generating something unexpected without the quotes (and where `rm foo*bar?` and `rm "foo*bar?"` might yield different results). rm -rf ./-help rm -rf -- -help will work in this example. -- Ryan "Cheshire" Younce / ryan@manunkind.org / http://www.manunkind.org/~ryan/ "As in certain cults it is possible to kill a process if you know its true name." -- Ken Thompson and Dennis M. Ritchie To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message