In Bash, how can I most easily check that the filename of a regular file is of the format shown below?
<filename>.<md5sum of file content>
For example, assume I had a file whose original name was foo.txt and had this content:
Hello world
The md5sum of this file is:
f0ef7081e1539ac00ef5b761b4fb01b3
Therefore, I have already changed the filename to:
foo.txt.f0ef7081e1539ac00ef5b761b4fb01b3
How, in Bash, may I best do the string processing necessary to verify that the portion of the filename after the last dot is indeed the md5sum of the file's content?