Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: brace expansion in function
- X-seq: zsh-users 7529
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: brace expansion in function
- Date: Sat, 12 Jun 2004 21:31:36 -0700 (PDT)
- In-reply-to: <20040613015124.GK12538@xxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: zsh-users@xxxxxxxxxx
- Sender: schaefer@xxxxxxxxxxxxxxxxxx
On Sun, 13 Jun 2004, Eric Smith wrote:
> I would like a shell function that expands the arg
> {corrs,dylan,crespo}
Do you mean that you have typed
mpg {corrs,dylan,crespo}
?? If that's what you did, then the shell will have expanded the braces
before invoking the function, so it is the same as if you'd typed
mpg corrs dylan crespo
(which is actually fewer characters, so I'm not sure why you didn't just
type that directly) in which case what you want is something like
mpg() { mpg321 *${^@}* }
If instead you mean that you typed
mpg '{corrs,dylan,crespo}'
or some such quoting, then you need
mpg() { eval "mpg321 *$1*" }
If none of this looks reasonable, you'll have to ask a more detailed
question.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author