Script for checking yesterday's log

Hi,

Have to check log file for yesterday, I have tried this script, but it is showing error as -d illegal option.
res=max_total`date -d'yesterday'+%y%m%d`.log

res=max_total`date +%y%m%d`.log
this is working fine for today.

Please help me on this.

Thanks in advance,
Neha.

The -d option is only available for the GNU version of date.

See Yesterdays Date/Date Arithmetic

Jean-Pierre.

There are a bunch of threads regarding this stuff, search for yesterday with the Google Custom Search function right above the page.

find <log dir> -mtime -1 -name <*.log> -print