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

Re: Double Evaluation Question (not in FAQ)



On Mon, Sep 04, 2006 at 08:18:19AM +0200, Com MN PG P E B Consultant 3 wrote:
> 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.
[...]

print -r -- ${(e)z}

-- 
Stéphane



Messages sorted by: Reverse Date, Date, Thread, Author