zsh-users
 help / color / mirror / code / Atom feed
From: "Com MN PG P E B Consultant 3" <mn-pg-p-e-b-consultant-3.com@siemens.com>
To: "zsh-users Mailinglist" <zsh-users@sunsite.dk>
Subject: Double Evaluation Question (not in FAQ)
Date: Mon, 4 Sep 2006 08:18:19 +0200	[thread overview]
Message-ID: <F7507090F1A72B43A51444325DFBE431011F293C@MCHP7R6A.ww002.siemens.net> (raw)

Assuming that variables are assigned in the following way:

  x=abc
  y=def
  z='$x   $y' # Note: Single Quotes!

How could I write an expression, which "evaluates" $z, in
that it would return "abc   def"? The simple

   eval "echo $z" 

would not work here, because it would not
preserve the spaces.

   eval "echo \"$z\""

would indeed do the job, but I consider this a very ugly
solution because of the nested quoting. Does anyone know 
a more elegant alternative?

Ronald
-- 
Ronald Fischer (phone +49-89-63676431)
mailto:mn-pg-p-e-b-consultant-3.com@siemens.com



             reply	other threads:[~2006-09-04  6:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-04  6:18 Com MN PG P E B Consultant 3 [this message]
2006-09-04  6:28 ` Stephane Chazelas

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=F7507090F1A72B43A51444325DFBE431011F293C@MCHP7R6A.ww002.siemens.net \
    --to=mn-pg-p-e-b-consultant-3.com@siemens.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).