Hi,
I am trying to set a variable that has time the format desired. And my intention is to echo variable (instead of actual date command) everytime I like to echo date. Please take a look at below code.
$NOW='['$(date +"%Y-%d-%m %r")']'
echo $NOW
[2013-22-07 04:09:36 AM]
After 5 minutes
$echo $NOW
[2013-22-07 04:09:36 AM]
Issue here is , I am not able to figure out how to evaluate NOW varialbe at run time. It keeps displaying the same time.
I tried some combinations with expr , eval and " ` " , but none of them work.
Can you please help me here.