Reputation: 1154
The following works if I type it in a shell window. But how do I get the result into a variable?
date -j -v+1m -f "%a %b %d %T %Z %Y" "`date`" "+%s"
Upvotes: -1
Views: 167
Reputation: 77075
You can use command substitution $(..)
and capture the output in a variable
var=$(date -j -v+1m -f "%a %b %d %T %Z %Y" "`date`" "+%s")
echo $var
Upvotes: 2