title: Formatting the date in unix to include suffix on day (st, nd, rd and th)
body: <p>How can I add the suffix on the <em>day</em> number of a unix date?</p>
  
  <p>I'll explain. I have a TextMate bundle snippit that writes out today's date. It uses unix date and formatting. Here is the code:</p>
  
  <pre><code>`date +%A` `date +%d` `date +%B` `date +%Y`
  </code></pre>
  
  <p>It outputs:</p>
  
  <p><strong>Monday 22 March 2010</strong></p>
  
  <p>I would like to add the suffix to the <em>day</em> (<strong>st</strong>, <strong>nd</strong>, <strong>rd</strong> and <strong>th</strong>) like so:</p>
  
  <p><strong>Monday 22nd March 2010</strong></p>
  
  <p>As far as I can see, there is no native function in the unix date formatting, like there is in PHP (j). How would I achieve this in unix? A complicated regex on the day number?</p>