title: BASH: print the next monday of date
body: <p>How can I calculate the date of the Monday of next week?
  For example, if I have one variable with this day:</p>
  
  <pre><code>DAYCHECK=2012-10-24 
  </code></pre>
  
  <p>the calculation of the next-monday doesn't work:</p>
  
  <pre><code>date -d $DAYCHECK -dnext-monday +%Y%m%d
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I have solved whit this method:</p>
  
  <pre><code>numdaycheck=`date -d $DAYCHECK +%u`
  sum=$((8-$numdaycheck))
  date=`date -d "$DAYCHECK $sum days" +%Y%m%d`
  </code></pre>