im trying to create agenda in bash but there is one thing that i dont now how to solve. Here is an example:
Code:
datum="[0-3][0-9]-[0-1][0-9]-[0-9][0-9][0-9][0-9]"
echo "Unesite datum obaveze (dan-mesec-godina (primer: 21-12-2008)): "; read obaveza
while [ "$obaveza" != $datum ]
do
echo "GRESKA: Datum obaveze nije unet u ogovarajucem formatu!"
echo "Unesite datum obaveze (dan-mesec-godina (primer: 21-12-2008)): "; read obaveza
done
Since i need correct date in $obaveza i need to check that input but there is error. I dont now how to solve it and i belive that my code is not good so can somebody help me?
What i need:
1. read $obaveza
2. Compare $obaveza with $datum (in $datum i use range of numbers and they are representing DD-MM-YYYY)
3. If there is no "good" input you need to try again.
Thanks
Bookmarks