title: How to set a variable to current date and date-1 in linux?
body: <p>I want to set the variable <code>date-today</code> to the current date, and <code>date_dir</code> to yesterday's date, both in the format <code>yyyy-mm-dd</code>.</p>
  
  <p>I am doing this:</p>
  
  <pre><code>#!/bin/bash
  d=`date +%y%m%d%H%M%S`
  echo $d
  </code></pre>