I have a need in a bash script to see if a string ends in an underscore and a date, of the form:
_yyyymmdd
I don't care about validating the date at this point, just that I have something like
abc_def_yyyymmdd
or
abc_yyyymmdd
(Note there may be other underscores in the name that I don't care about; I only care that it ends in _yyyymmdd -- an underscore followed by 8 digits).
Can you assist me in that pattern match test? Let me be clear based on a comment that I don't care about validating the date at this point, just that the string (a filename) ends in an underscore and 8 digits.