title: Extract month and day from linux "date" command
body: <p>I would like to modify the following statement to extract the Month, as well as day:</p>
  
  <blockquote>
    <p>testdate=$(date -d "2 days" +%d| sed 's/0([1-9])/ \1/')</p>
  </blockquote>
  
  <p>right now it only extracts the day...</p>
  
  <p>I'm currently googling how sed works.  looks like a regular expression of sorts that's being used but... I thought I'd check with the forum for certain. </p>
  
  <p>Thanks. </p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>now I have: </p>
  
  <pre><code>  testdate=$(date -d "2 days" "+%b %_d %Y")
  </code></pre>
  
  <p>Which is great... except when the leading zeros in the day are stripped out.  then i end up with two spaces between the Month and day
  for example, for April 29, 2014, I get:</p>
  
  <pre><code>  Apr 29 2014
  </code></pre>
  
  <p>which is great.  But for May 01, 2014 I get: </p>
  
  <pre><code>  May  1, 2014
  </code></pre>
  
  <p>where there's a double space between "May" and "1".  I guess i can do it in two steps... by doing the date command, followed by sed to find and replace double spaces. 
  Just wondering if there's a way to do it all in one command. 
  Thanks. </p>