Korn Shell Date Formatting

I am serching for a file created today like so:

 
 
TODAY=$(date +"%b-%d")
 
T_FILE=$(find /export/home/dan/ck/reports/t-status-t.txt-$TODAY-05-00-0?.csv)

The file it is searching for is titled:

 
/export/home/dan/ck/reports/t-status-t.txt-Jun-29-05-00-01

however, I when the day of the month is between 1 and 9, the file generated is in the following format:

 
 
/export/home/dan/ck/reports/t-status-t.txt-Jul--1-05-00-01. 

So I would like a way for the date format to be able to look for both Jul--1, Jul--2, Jul--3.....Jul--9, Jul-10, Jul-11 and so on. This should be applicable for every month of the year...
any suggestions? The only thing that comes to mind is an if statement but I was wondering if there was an easier way....Thanks.

This will do it:

date +"%b-%d" | sed 's/-0/--/'
1 Like
TODAY=$(date +"%b-%d" | sed 's/-0/--/')
1 Like