I am not very experienced with bash scripting. But I am trying to validate individual xml files with corresponding xsd files in a directory. The beginning name does not change but the dates changes.
For example:
- File1.xsd
- File2.xsd
- File3.xsd
- File1_random_date.xml (random date time can be 2016_06_12_10_38_13)
- File2_random_date.xml
- File2_random_date.xml
- File3_random_date.xml
I would like validate all File2*.xml files against File2.xsd and all File1*.xml against File1.xsd etc etc
something like:
xmllint --noout --schema File2.xsd File2_*.xml
xmllint --noout --schema File1.xsd File1_*.xml
But i am not sure how to have regex string maybe for dates and say if File2_*.xml exist, validates each file against File2.xsd.
Any help please?
*
represents zero of more characters and?
represents a single character. Just like you're using them in your Question.