I'm trying to evaluate dateFrom
variable inside dateCalc
variable
that evaluate PHP command.
dateFrom="2013-01-05"
dateCalc=$(php -r '$date = new DateTime($dateFrom);echo $date->add(DateInterval::createFromDateString("-2 days"))->format("Y-m-d");')
In the actual script, the date will be dynamic var.
Is there a way I can evaluate the dateFrom
inside the PHP command?
if it's not possible, is there a way I can achieve the same result of the PHP command in another way? other shell commands?