-1

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"
1
  • 1
    Please state the type of shell. Syntax will vary. Commented Jan 19, 2012 at 19:54

1 Answer 1

2

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

Note: Not tested and as stated in the comments, the syntax may vary.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.