Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: globbing and quoting in a function
- X-seq: zsh-users 9114
- From: Stefan Reichör <stefan@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: globbing and quoting in a function
- Date: Wed, 20 Jul 2005 10:29:34 +0200
- Cancel-lock: sha1:lVdlLcYGTN83EgCJgr+sWLAkpow=
- 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> <1050720074817.ZM7476@xxxxxxxxxxxxxxxxxxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
> 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'
Thanks for summarizing it. I overlooked the ~ in Doug's message.
I use it now the following way to allow calling without a parameter also:
function lsnew () {
if [[ $1 = "" ]]; then
lsnew_glob="*"
else
lsnew_glob=$1
fi
ls -tr -dl $~lsnew_glob(om[1,30])
}
alias lsnew='noglob lsnew'
Stefan.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author