Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

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