26 lines
549 B
Bash
26 lines
549 B
Bash
|
#!/bin/sh
|
||
|
|
||
|
# $1 = 2013-11-08
|
||
|
|
||
|
date_in=2013-11-08
|
||
|
len=28
|
||
|
|
||
|
len_s=$(( 28 * 24 * 60 * 60 ))
|
||
|
|
||
|
# convert to ts
|
||
|
date_s_in=$(date -jf %Y-%m-%d +%s $date_in)
|
||
|
|
||
|
# add len
|
||
|
date_s_out1=$(( date_s_in + len_s ))
|
||
|
date_s_out2=$(( date_s_out1 + len_s ))
|
||
|
date_s_out3=$(( date_s_out2 + len_s ))
|
||
|
|
||
|
date_out1=$(date -jf %s +%Y-%m-%d $date_s_out1)
|
||
|
date_out2=$(date -jf %s +%Y-%m-%d $date_s_out2)
|
||
|
date_out3=$(date -jf %s +%Y-%m-%d $date_s_out3)
|
||
|
|
||
|
echo "$date_in + $len days = $date_out1"
|
||
|
echo "$date_out1 + $len days = $date_out2"
|
||
|
echo "$date_out2 + $len days = $date_out3"
|
||
|
|