From owner-freebsd-questions Fri Dec 1 15:39:46 2000 Delivered-To: freebsd-questions@freebsd.org Received: from post.mail.nl.demon.net (post-11.mail.nl.demon.net [194.159.73.21]) by hub.freebsd.org (Postfix) with ESMTP id 05AF237B6C1 for ; Fri, 1 Dec 2000 15:25:44 -0800 (PST) Received: from [212.238.77.116] (helo=buffy.raggedclown) by post.mail.nl.demon.net with smtp (Exim 3.14 #4) id 141zYf-000BcL-00; Fri, 01 Dec 2000 23:25:38 +0000 Received: (from cliff@localhost) by buffy.raggedclown (8.10.2/8.10.2) id eB1LueR02224; Fri, 1 Dec 2000 22:56:40 +0100 Date: Fri, 1 Dec 2000 22:56:40 +0100 From: Cliff Sarginson To: Mike Meyer Cc: Larry Rosenman , Daniel.Bye@uk.uu.net, questions@freebsd.org Subject: Re: Pesky file Message-ID: <20001201225640.A2189@buffy.local> References: <119603073@toto.iv> <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: <14888.4617.148599.530943@guru.mired.org>; from mwm@mired.org on Fri, Dec 01, 2000 at 03:03:05PM -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Dec 01, 2000 at 03:03:05PM -0600, Mike Meyer wrote: > Larry Rosenman types: > > * Daniel Bye [001201 05:21]: > > > Hi all, > > > > > > Here's a question for a Friday morning... Somehow, I have ended up with a > > > file named -help in my home directory. How can I get rid of it? It is 0 > > > bytes, > > > and if I try to rm, mv, unlink it etc, the shell interprets the file name as > > > an > > > argument to the program and spews forth errors. Backslash escaping it > > > doesn't work, and neither does quoting it. > > rm -- -help > > > > or rm -i ?help > > That won't work any more than "rm *help" would. The problem with both > of them is that the shell expands the metacharacters, so that rm sees > the "-" first, so thinks it's an argument. You are wrong btw, "rm -- -help" will work just fine :) "--" is a feature of rm (and mv etc) to get around this very problem. Before saying "that's wont work", take 23 seconds to try it out. Cliff > > Just FWIW, if you happen to be on a system that doesn't recognize the > "--" convention (or need to run a command that doesn't), you can > always do "rm ./-help". > > Trivia question: what two bytes can you *not* put in a Unix filename? > > -- > Mike Meyer http://www.mired.org/home/mwm/ > Independent WWW/Unix/FreeBSD consultant, email for more information. > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message