I'M trying to write a small program that will validate weather or not a string is valid. Assuming that the date will always be 8 digits (12/21/2012) I need a function that will count the number of digits in a string. What I've got below is only returning "'is not 8 digits' even when I am inputing 8 digits.
! /bin/bash
This is the calender array for the DateValidation program
calender=(31 28 31 30 31 30 31 31 30 31 30 31)
read -p "Enter a date for validation: " Date
set the variable "LEN" to hold the lengh of the input number
LEN=$(echo ${Date})
if [ $LEN -lt 8 ]; then
echo "$Date' is 8 characters'"
else "$Date' is not 8 characters'"
fi
END