title: How can I get and format yesterday's date on the command line?
body: <p>I have a Perl script which will run in a cron job on linux suse. It will take as input a log file that was generated yesterday. The filename of the log contains the date (i.e. log.20100209)</p>
  
  <p>Can I send yesterday's date with the format in the prompt? Should I create an additional script to get the date and execute? If so, how can I do that?</p>
  
  <p>Thanks</p>
  
  <pre><code>perl myscript.pl -f log.20100209
  </code></pre>
  
  <p><strong>Edit</strong></p>
  
  <p>Thanks for your help</p>
  
  <p>It worked with:</p>
  
  <pre><code>perl myscript.pl -f log.`date --date='yesterday' '+%Y%m%d'`
  </code></pre>