zsh-users
 help / color / mirror / code / Atom feed
* Forcing expansion without explicit eval nor a subshell?
@ 2005-11-05  4:01 Lloyd Zusman
  2005-11-05  8:45 ` DervishD
  2005-11-05 19:56 ` Bart Schaefer
  0 siblings, 2 replies; 9+ messages in thread
From: Lloyd Zusman @ 2005-11-05  4:01 UTC (permalink / raw)
  To: zsh-users

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

In both cases, it expands to this before execution (line wrapping added
for clarity):

  yum --disablerepo=livna         \
      --disablerepo=livna-updates \
      --disablerepo=livna-testing \
      --disablerepo=livna-extras  \
      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, ``).

I want to assign to "yumargs" exactly as I did above, if possible, and
I'm looking for some combination of modifiers within the ${} construct
which would give me the expansion of "yumargs" that I desire, and
without the need for a subshell.  And I'd like the expansion of
"yumargs" to take place at the time it is used in the "yum" command, not
at the time that I define it.

Is all this possible?  If so, could someone give me a hint or pointer?

By the way, I tried the (e) operator within the ${} construct, but that
didn't work for me.

Thanks in advance for your suggestions.


-- 
 Lloyd Zusman
 ljz@asfast.com
 God bless you.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-06  3:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-05  4:01 Forcing expansion without explicit eval nor a subshell? Lloyd Zusman
2005-11-05  8:45 ` DervishD
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

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).