Script on Date Range

Hi All,

Can anybody help me out a Shell script which pulls the files based on date range

Example

./test.sh start_date End_date (20110901 20110930)
or
./test.sh ( if we don't provide any input)
it should take sysdate-1 ( yesterdays date)

it should have both conditions

Plzz help me out...it quite urgent for me.....plzzzzzzzzz

Please, for date calculations, refer to this link:
http://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html