Shell script user prompt/input
If you want to be prompted (as opposed to passing the date in as a parameter), use the following logic (or something similar):
date=while [ -z $date ]do echo -n 'Date? ' read datedone
That loop will continue to prompt for the date until the user enters something (anything) other than a simple RETURN.
If you want to add some simple validation, and you're using a version ofKSH that's KSH93 or better, do something like this:
date=while [ -z $date ]do echo -n 'Date? ' read date if [[ $date =~ ^[0-9]{1,2}/[0-9]{1,2}/[0-9]{1,4}$ ]] then break fi date=done
See the ksh93 man page for more info.