Date: Fri, 1 Dec 2000 19:03:35 -0500 From: Ryan Younce <ryan@manunkind.org> To: Joe Oliveiro <joe@advancewebhosting.com> Cc: Mike Meyer <mwm@mired.org>, Larry Rosenman <ler@lerctr.org>, Daniel.Bye@uk.uu.net, questions@FreeBSD.ORG Subject: Re: Pesky file Message-ID: <20001201190335.A35590@cheshire.manunkind.org> In-Reply-To: <Pine.BSF.4.21.0012011703120.17623-100000@joe.pythonvideo.com>; from joe@advancewebhosting.com on Fri, Dec 01, 2000 at 05:03:22PM -0500 References: <14888.4617.148599.530943@guru.mired.org> <Pine.BSF.4.21.0012011703120.17623-100000@joe.pythonvideo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Thus spake Joe Oliveiro <joe@advancewebhosting.com>: > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001201190335.A35590>