From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: brace expansion in function
Date: Sat, 12 Jun 2004 21:31:36 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0406122125250.32342-100000@toltec.zanshin.com> (raw)
In-Reply-To: <20040613015124.GK12538@fruitcom.com>
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.
next prev parent reply other threads:[~2004-06-13 4:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-13 1:51 Eric Smith
2004-06-13 4:31 ` Bart Schaefer [this message]
2004-06-13 12:53 ` Eric Smith
2004-06-13 16:04 ` Thomas Köhler
2004-06-14 7:37 ` ignore globs that do not match Eric Smith
2004-06-14 8:31 ` Bart Schaefer
2004-06-22 6:56 ` ignore globs that do not match -> prevent function from exiting Eric Smith
2004-06-22 7:17 ` Bart Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44.0406122125250.32342-100000@toltec.zanshin.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).