[NTLUG:Discuss] verify that a text string is a valid date.
Paul M Foster
paulf at quillandmouse.com
Wed Feb 1 21:20:40 CST 2006
Richard Geoffrion wrote:
> I'm trying to do something but I don't know what it is called.
>
> I want to check to see if the first 10 characters of a file is a vaild
> date...eg 2006-02-01 and if it IS..then I want to continue the process.
>
> What am I trying to do in bash(or other utility terms)? I don't know
> the name of what I'm trying to do so I'm finding it difficult to search.
>
It's called "grepping". You're trying to do a regular expression search,
which can be accomplished with grep. See man 7 regex and man grep. (And
of course, the whole thing can be wrapped in bash.)
--
Paul M. Foster
More information about the Discuss
mailing list