Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Double Evaluation Question (not in FAQ)
- X-seq: zsh-users 10670
- From: "Com MN PG P E B Consultant 3" <mn-pg-p-e-b-consultant-3.com@xxxxxxxxxxx>
- To: "zsh-users Mailinglist" <zsh-users@xxxxxxxxxx>
- Subject: Double Evaluation Question (not in FAQ)
- Date: Mon, 4 Sep 2006 08:18:19 +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Thread-index: AcbP6eqAy/Ln+XNuRGC5wbMkh0YCAw==
- Thread-topic: Double Evaluation Question (not in FAQ)
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@xxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author