typeset input
#日期取得
while true
do
printf "请输入日期:"
printf ""exit"\n退出循环"
printf "[YYYY-MM-DD]==>"
read $input
if [["${input}" = "exit"]]
then
return 0
fi
if [[${input} != [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] ]]
then
printf "日期形式错误:【输入值为:${input}】"
continue
else
break
fidone