B
Bretenn
Guest
i wan to create a linux program...... and 1 of the option is to enter a valid date.... below is the code for the date
while :
do
printf "Date Commissioned (dd/mm/yy): "
read date
if test -z "$date"
then
echo "ERROR: field cannot be blank"
else
break
fi
done
this code only check for null........ how can i check or detect if the user type in character instead of numeric..... and then print a message.....
and the length is only 6...
what can i add into the code if want to enable this error..... i only wan some simple coding....... and if can please add the code to the date code.....10q
thanks in advance....... hope u guys can help me :_
while :
do
printf "Date Commissioned (dd/mm/yy): "
read date
if test -z "$date"
then
echo "ERROR: field cannot be blank"
else
break
fi
done
this code only check for null........ how can i check or detect if the user type in character instead of numeric..... and then print a message.....
and the length is only 6...
what can i add into the code if want to enable this error..... i only wan some simple coding....... and if can please add the code to the date code.....10q
thanks in advance....... hope u guys can help me :_