shell如何实现date格式不对重新输入
#!/bin/bashechopleaseinputdatereaddateif[${#date}=10];thenechodateformatisrightelseec...
#!/bin/bash
echo please input date
read date
if [ ${#date} = 10 ];
then
echo date format is right
else
echo please input date again
read date
fi
这样只能重新输入一次,想实现多次输入,怎么用循环实现啊??? 展开
echo please input date
read date
if [ ${#date} = 10 ];
then
echo date format is right
else
echo please input date again
read date
fi
这样只能重新输入一次,想实现多次输入,怎么用循环实现啊??? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询