Hi,
It's not a script, but this will fill a variable with yesterday's date:
YESTERDATE=`TZ=CST+24 date +%Y%m%d`
Shouldn't be to hard to implement that in a script
If the date layout is not to your liking, take a look at man date for other possibilities.
Hope this helps.