title: How do I use output from awk in another command?
body: <p>So I need to convert a date to a different format. With a bash pipeline, I'm taking the date from the last console login, and pulling the relevant bits out with awk, like so:</p>
  
  <pre><code>last $USER | grep console | head -1 | awk '{print $4, $5}'
  </code></pre>
  
  <p>Which outputs: <code>Aug 08</code> 
  ($4=Aug $5=08, in this case.)</p>
  
  <p>Now, I want to take 'Aug 08' and put it into a <code>date</code> command to change the format to a numerical date.</p>
  
  <p>Which would look something like this:</p>
  
  <pre><code>date -j -f %b\ %d Aug\ 08 +%m-%d
  </code></pre>
  
  <p>Outputs: 08-08</p>
  
  <p>The question I have is, how do I add that to my pipeline and use the awk variables $4 and $5 where 'Aug 08' is in that date command?</p>