vodkadrinker
Technical User
I am writing a simple script in bash so that it is easily portable, is there an easy way to validate a string is a date?
Example
My string should come back in the format "2013-03-07" CCYY-MM-DD however it may be blank or anything, if it's not in a date format then I would like to ignore it.
Example
My string should come back in the format "2013-03-07" CCYY-MM-DD however it may be blank or anything, if it's not in a date format then I would like to ignore it.
Code:
if [ $mydatestring == validdate ] ; then
...do some stuff...