(Sorry if this is a duplicate post, I sent the original yesterday and
never saw it myself)

I have this rather ugly method of generating a directory name that is
a date (YYYYMM).  Part of the ugliness comes from having to pipe the
output from date through awk to reduce the month by one because it
gets called from a cron job at midnight on the first of each month.

Does anybody have a cleaner method of doing this?

DirName=$HOME/Mail/Archives/$(echo -e "$(date +%Y%m)" \
       | awk '{if ((($1-1)%100)==0) print  $1-89; else \
       print $1-1 }')


-- 
       _
     _|_|_
      ( )   *    Anton Graham
      /v\  /     <[EMAIL PROTECTED]>
    /(   )X
     (m_m)       GPG ID: 18F78541
Penguin Powered!

Reply via email to