From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6578 invoked from network); 3 Sep 1999 04:54:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Sep 1999 04:54:38 -0000 Received: (qmail 6350 invoked by alias); 3 Sep 1999 04:54:22 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2557 Received: (qmail 6343 invoked from network); 3 Sep 1999 04:54:20 -0000 From: "Bart Schaefer" Message-Id: <990903045410.ZM25110@candle.brasslantern.com> Date: Fri, 3 Sep 1999 04:54:10 +0000 In-Reply-To: <37CF36E2.E0627CAC@pdi.com> Comments: In reply to dado "Re: strange glob expansion" (Sep 2, 7:48pm) References: <19990901101116.A8076@youkaidi.irisa.fr> <990901174608.ZM19896@candle.brasslantern.com> <19990902121532.A24349@youkaidi.irisa.fr> <990902150120.ZM24598@candle.brasslantern.com> <37CF36E2.E0627CAC@pdi.com> X-Mailer: Z-Mail (5.0.0 30July97) To: dado , Subject: Re: strange glob expansion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 2, 7:48pm, dado wrote: } Subject: Re: strange glob expansion } } > That's what `setopt cshnullglob` is for. I can't imagine why anyone would } > not want that option when the shell is interactive; brace expansion is } > practically useless without it. } } It's true. It always annoyed me that a no match would brake the whole thing. } But I just tried setopt cshnullglob to no avail. } It's still complaining about a no match, even if there are other matches: } } dado@saci:~/pdi/timesheet 16 -> setopt | grep null } cshnullglob } } dado@saci:~/pdi/timesheet 17 -> ll 99090{0,1,2,3} } UX:ls: ERROR: Cannot access 990900: No such file or directory } UX:ls: ERROR: Cannot access 990903: No such file or directory No, look: It's not zsh claiming "no match", it's "ls" saying there is no such file. Besides, there are no glob patterns in that example, so you would not get "no match" even if you unsetopt cshnullglob. This is a subtle but important point: Brace expansion is not globbing. Brace expansion happens before globbing; "ll 99090{0,1,2,3}" is exactly the same as typing out "ll 990900 990901 990902 990903". In other words, the result of brace expansion is not tested against the filesystem _unless_ there is also a * ? [] or parenthesized pattern in that result. (Or a number range, see below.) However, if instead you used 99090{0,1,2,3}*, that would expand to 990900* 990901* 990902* 990903*, which zsh would test against the file names and therefore throw out 990900* 990903* as not matching. If you did not use nullglob or cshnullglob, zsh would complain "no match." } I also would like to have the same behavior on 99090{0..3} } Is that possible? In this case, you probably want number ranges: ll 99090<0-3> Or ll <990900-990903> The form lessthan digits hyphen digits greaterthan is a glob pattern, too (I should have mentioned that in my last message to Adam). <123-> means "all numbers greater than 123," <-789> means "all numbers less than 789," and <-> means "any number." This is a bit surprising as it looks like a redirection, but eventually one runs out of nonalphanumeric characters to use as delimiters. Parens were already far too overloaded. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com