From owner-freebsd-questions Wed Feb 12 13: 6:32 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48FA537B401 for ; Wed, 12 Feb 2003 13:06:31 -0800 (PST) Received: from wopr.caltech.edu (wopr.caltech.edu [131.215.103.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FE9143F85 for ; Wed, 12 Feb 2003 13:06:28 -0800 (PST) (envelope-from mph@wopr.caltech.edu) Received: from wopr.caltech.edu (localhost.caltech.edu [127.0.0.1]) by wopr.caltech.edu (8.12.3/8.12.3) with ESMTP id h1CL6O3v085568; Wed, 12 Feb 2003 13:06:24 -0800 (PST) (envelope-from mph@wopr.caltech.edu) Received: (from mph@localhost) by wopr.caltech.edu (8.12.3/8.12.3/Submit) id h1CL6Nbv085567; Wed, 12 Feb 2003 13:06:23 -0800 (PST) Date: Wed, 12 Feb 2003 13:06:23 -0800 From: Matthew Hunt To: Kent Stewart Cc: Ruben de Groot , parv , David Banning , questions@FreeBSD.ORG Subject: Re: how to delete a file called ???? Message-ID: <20030212210623.GA85508@wopr.caltech.edu> References: <20030212111232.A6759@skytrackercanada.com> <200302121145.33271.kstewart@owt.com> <20030212204251.GA74324@ei.bzerk.org> <200302121259.18010.kstewart@owt.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302121259.18010.kstewart@owt.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Feb 12, 2003 at 12:59:18PM -0800, Kent Stewart wrote: > I had always used the -i to go along with it. I tried it with ??? and > abc and a "rm -- ???" deleted both files, which wasn't what I expected > if wildcarding was turned off with the "--". WILDCARD PROCESSING IS NOT TURNED OFF WITH "--". Sorry for yelling, but every time someone asks about removing a file with an odd name, wrong notions like this one surface. In Unix, wildcard processing is handled by the shell, not the program you're running. The program you're running gets the wildcard-expanded filenames, and has no idea whether you used a wildcard or typed them by hand. (This explains why "mv *.foo *.bar" does not work the way a DOS user would expect it to.) "--" is an option processed by rm, just like "-r" or "-i". It tells rm to stop processing further options (i.e. treat arguments that start with "-" as filenames rather than options.) It has nothing to do with wildcard processing, because the wildcards have already been expanded by the time rm even has a chance to weigh its options. "--" is the answer to "How do I delete a file called -i" not "How do I delete a file called ???". But some people seem to think they're all the same question. As I've mentioned before in this thread, it's completely possible that the file doesn't even have question marks in its name, anyway, because ls will display unprintable characters as question marks. -- Matthew Hunt * UNIX is a lever for the http://www.pobox.com/~mph/ * intellect. -J.R. Mashey To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message