From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22712 invoked from network); 2 Jun 2005 16:20:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Jun 2005 16:20:26 -0000 Received: (qmail 79628 invoked from network); 2 Jun 2005 16:20:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Jun 2005 16:20:20 -0000 Received: (qmail 5041 invoked by alias); 2 Jun 2005 16:20:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8944 Received: (qmail 5032 invoked from network); 2 Jun 2005 16:20:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Jun 2005 16:20:10 -0000 Received: (qmail 78414 invoked from network); 2 Jun 2005 16:20:10 -0000 Received: from vms044pub.verizon.net (206.46.252.44) by a.mx.sunsite.dk with SMTP; 2 Jun 2005 16:20:06 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms044.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IHG00171TDBF610@vms044.mailsrvcs.net> for zsh-users@sunsite.dk; Thu, 02 Jun 2005 11:20:00 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j52GJxVv012713 for ; Thu, 02 Jun 2005 09:19:59 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j52GJwkD012712 for zsh-users@sunsite.dk; Thu, 02 Jun 2005 09:19:59 -0700 Date: Thu, 02 Jun 2005 16:19:58 +0000 From: Bart Schaefer Subject: Re: ranges In-reply-to: <200506021557.22069.cht@chello.at> To: "zsh-users" Message-id: <1050602161959.ZM12711@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <200506011828.32719.cht@chello.at> <200506021557.22069.cht@chello.at> Comments: In reply to Christian Taylor "Re: ranges" (Jun 2, 3:57pm) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 When discussing {N..M} and {X,Y} in comparison to and (X|Y), the most important thing to keep in mind is: Brace expansions create new strings. Patterns select existing strings. For example, [[ 7 = {1..9} ]] is nonsense, but [[ 7 = <1-9> ]] works. David's summary goes wrong as soon as "ls" becomes the example command, because that egregiously translates all the strings into the namespace of existing files. Neither braces nor patterns inherently operate on files. (*) A better example would have used "print" or "echo". (* Some glob qualifiers operate on files, but that's independent of the pattern part. The seeming special case of slashes in globbing occurs not because the patterns are matched differently, but because globbing interprets a series of patterns separated by slashes, comparing each pattern in the series to a different set of existing strings, each set happening to consist of file names.)