I have a pretty simple C program for generating date-sensitive commands.  It uses all 
the arguments from the command line, does substition of the Date variables, then runs 
the system command with the result.   Ugly looking, yet handy:

Eric Aksomitis
http://www.dlcwest.com/~jed/re_answer.shtml


Tom Berger wrote:
> 
> On Sat, 03 (06/00) at 12:19 +0000, Anton Graham <[EMAIL PROTECTED]> wrote:
> > (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 }')

TMSCRIPT.C

Reply via email to