How to evaluate a shell variable each time it's used
问题 Related to a similar problem I'm having: zsh not re-computing my shell prompt Is there any way to define a shell variable such that its value is calculated each time its called? for example if I do: my_date="today is $(date)" The value in my_date would be: today is Thu Aug 9 08:06:18 PDT 2012 but I want the date to be executed each time my_date is used. In the linked post, somebody recommended putting the value in single quotes: my_date='today is $(date)' but never evaluates anything, it just