From owner-freebsd-questions Sat Aug 26 17:14: 3 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mailgw00.execpc.com (mailgw00.execpc.com [169.207.1.78]) by hub.freebsd.org (Postfix) with ESMTP id 1DE6337B43C for ; Sat, 26 Aug 2000 17:13:58 -0700 (PDT) Received: from woodstock.monkey.net (d75.as28.nwbl0.wi.voyager.net [169.207.69.75]) by mailgw00.execpc.com (8.9.1) id TAA12836; Sat, 26 Aug 2000 19:13:52 -0500 Received: from pobox.com (localhost [127.0.0.1]) by woodstock.monkey.net (Postfix) with ESMTP id AB0DB137; Sat, 26 Aug 2000 19:13:51 -0500 (CDT) X-Mailer: exmh version 2.1.1 10/16/1999 To: "Philip M. Gollucci" Cc: Evren Yurtesen , freebsd-questions@FreeBSD.ORG Subject: Re: how to delete all files but the XYZ file. In-reply-to: Your message of "Sat, 26 Aug 2000 19:11:09 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 26 Aug 2000 19:13:50 -0500 From: Jon Hamilton Message-Id: <20000827001352.AB0DB137@woodstock.monkey.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message , "Philip M. Gollucci" wrote: [ discussion of how to remove all but a few files from a directory ] } the rm command supports regex expressions. No, it doesn't, for two reasons; both may seem nit-picky but the distinction is important. First, what you're talking about are shell globs, not regexes. They're not interchangable (that's the more esoteric argument). Secondly, those globs are interpreted by the _shell_, not by the rm command. This may not make much difference to the end user, but it's important to understand in the framework of UNIX. Commands don't do this kind of expansion themselves, they just take what the shell hands them. In this way, commands all behave the same way when it comes to parameter expansion. When you say: $ rm *foo the shell actually expands *foo and hands the result off to rm. -- Jon Hamilton hamilton@pobox.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message