From: DervishD <zsh@dervishd.net>
To: Lloyd Zusman <ljz@asfast.com>
Cc: zsh-users@sunsite.dk
Subject: Re: Forcing expansion without explicit eval nor a subshell?
Date: Sat, 5 Nov 2005 09:45:41 +0100 [thread overview]
Message-ID: <20051105084541.GB182@DervishD> (raw)
In-Reply-To: <m364r73fpp.fsf@asfast.com>
Hi Lloyd ;)))))
* Lloyd Zusman <ljz@asfast.com> dixit:
> Suppose I have the following variable defined:
>
> yumargs='--disablerepo=livna{,-updates,-testing,-extras}'
>
> I know that I can do this:
>
> eval yum ${yumargs} update
>
> And this:
>
> yum $(eval print -- ${yumargs}) update
[...]
> However, I'm wondering if there is a way to get the same effect without
> explicitly using "eval" and without invoking a subshell via the $()
> construct (nor with its moral equivalent, ``).
Well, I'm by no means an expert, but as far as I know, Zsh does
parameter expansion *first* and brace expansion *last* in the same
step. As zsh does not reparse and rexpand, you need to first expand
the parameter and after that expand the braces. That's why you need
the eval.
> By the way, I tried the (e) operator within the ${} construct, but that
> didn't work for me.
Of course, because (e) doesn't perform brace expansion ;)
Sorry for not being much helpful O:) I'm sure that somebody here
can think of a solution without using "eval" (although that's why
eval exists...).
Buena suerte, Lloyd, y encantado de hablar otra vez contigo :)
(Good luck, Lloyd, and pleased to talk with you again):
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...
next prev parent reply other threads:[~2005-11-05 8:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-05 4:01 Lloyd Zusman
2005-11-05 8:45 ` DervishD [this message]
2005-11-05 19:56 ` Bart Schaefer
2005-11-05 20:03 ` Lloyd Zusman
2005-11-05 21:33 ` Bart Schaefer
2005-11-05 22:07 ` Lloyd Zusman
2005-11-05 22:44 ` OT: poldek [Re: Forcing expansion without explicit eval nor a subshell?] GoTaR
2005-11-06 3:02 ` Forcing expansion without explicit eval nor a subshell? Bart Schaefer
2005-11-06 3:40 ` Lloyd Zusman
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=20051105084541.GB182@DervishD \
--to=zsh@dervishd.net \
--cc=ljz@asfast.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).