From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7068 invoked from network); 19 Jul 2005 15:37:49 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Jul 2005 15:37:49 -0000 Received: (qmail 47289 invoked from network); 19 Jul 2005 15:37:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Jul 2005 15:37:35 -0000 Received: (qmail 16890 invoked by alias); 19 Jul 2005 15:37:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9110 Received: (qmail 16844 invoked from network); 19 Jul 2005 15:37:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Jul 2005 15:37:17 -0000 Received: (qmail 43977 invoked from network); 19 Jul 2005 15:37:17 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by a.mx.sunsite.dk with SMTP; 19 Jul 2005 15:37:14 -0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Duu8X-0004Ge-DF for zsh-users@sunsite.dk; Tue, 19 Jul 2005 17:36:01 +0200 Received: from 194.96.178.23 ([194.96.178.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Jul 2005 17:36:01 +0200 Received: from stefan by 194.96.178.23 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 Jul 2005 17:36:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk From: Stefan =?iso-8859-1?Q?Reich=F6r?= Subject: Re: globbing and quoting in a function Date: Tue, 19 Jul 2005 17:35:04 +0200 Message-ID: References: <20050719145955.GD3593@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 194.96.178.23 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:KQC+lD4TPXd9MciJwF9HX8gUilc= Sender: news Cc: zsh-workers@sunsite.dk X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,RCVD_BY_IP, RCVD_NUMERIC_HELO autolearn=no version=3.0.4 Doug Kearns writes: > On Tue, Jul 19, 2005 at 04:27:32PM +0200, Stefan Reichör wrote: >> Hi! >> >> I use the following alias to show the last 30 files changed: >> >> alias lsnew='ls -tr -dl *(om[1,30])' >> >> >> Now I want to convert it to a function to specify the '*' as >> parameter: >> >> I tried the following, but the $1 is not combined with the glob >> modifier. >> >> function lsnew () { >> ls -tr -dl $1(om[1,30]) > > ls -tr -dl $~1(om[1,30]) > >> } >> >> >> So is there a way to make 'lsnew a*' work? > > You'll need to quote the * as well. For example, > > lsnew a\* That does not work as expected: lsnew:1: no matches found: a*(om[1,30]) I would like to see all files, starting with a. The quoted \* seems to match the *. Stefan.