[Charlug] Script Question

Michael McCandless michael at prismbiz.com
Mon Mar 2 18:28:35 EST 2009


All, I would guess that this is a really simple question... but I can't
figure it out.

I have a script that grep's a file, looking for a date string, specifically:

FILEDATE=`date +"%b  %-d"`

This command works wonderfully up to the 10th of the month, when I have to
use:

FILEDATE=`date +"%b %-d"`  (only 1 space between %b and %-d)

If there some sort of if-then-else I can use based on the day of the
month, e.g.

IF day-of-month between 1 and 9
  FILEDATE=`date +"%b  %-d"`
ELSE
  FILEDATE=`date +"%b %-d"`
ENDIF


Thanks.


---------------------------
Michael McCandless
michael at prismbiz.com



More information about the CharLUG mailing list