Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing and quoting in a function
- X-seq: zsh-users 9113
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: globbing and quoting in a function
- Date: Wed, 20 Jul 2005 07:48:17 +0000
- In-reply-to: <m0u0iqkq1l.fsf@xxxxxxxxxx>Comments: In reply to Stefan Reichör <stefan@xxxxxxxxx> "Re: globbing and quoting in a function" (Jul 20, 7:24am)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <m0k6jmna5n.fsf@xxxxxxxxxx> <20050719145955.GD3593@xxxxxxxxxxxxxxxxxxxxx> <20050719152933.GA23645@xxxxxxxxx> <1050720035400.ZM7204@xxxxxxxxxxxxxxxxxxxxxxx> <m0u0iqkq1l.fsf@xxxxxxxxxx>
This business with gmane double-posting to both zsh-users and zsh-workers
is getting annoying. As gmane is apparently not clever enough to get this
right by themselves, would you gmane users please be polite and trim off
one of the two newsgroups when posting? (I don't know what names gmane
gives to their groups that are gatewayed to the zsh lists.)
On Jul 20, 7:24am, Stefan Reichör wrote:
}
} I'd like to call:
} lsnew *
} lsnew a*
}
} Is there an easy way to do it in zsh?
Yes. It's been answered in the previous postings.
function lsnew { ls -tr -dl $~1(om[1,30]) }
alias lsnew='noglob lsnew'
Once the alias has been defined, you must not attempt to re-define the
lsnew function unless you do so using the "function" keyword as above.
The existence of the alias causes the
lsnew() { ... }
syntax to do something different from what you would expect.
A drawback to the above is that you cannot do
lsnew *(.)
because that expands to
ls -tr -dl *(.)(om[1,30])
and two sets of glob qualifiers don't mix.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author