Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing and quoting in a function
- X-seq: zsh-workers 21494
- From: Stefan Reichör <stefan@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: globbing and quoting in a function
- Date: Tue, 19 Jul 2005 17:35:04 +0200
- Cancel-lock: sha1:KQC+lD4TPXd9MciJwF9HX8gUilc=
- Cc: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <m0k6jmna5n.fsf@xxxxxxxxxx> <20050719145955.GD3593@xxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Doug Kearns <dougkearns@xxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author