I'm trying to write a script (Perl) for the general public which would need to have a list of all installed TeX files of a certain type, e.g.
.cls files or only plainTeX files (
.tex), depending on the used options.
I know I can search for specific files using the
kpsewhich program, but it seems to have no 'list all' mode (which is understandable). My second idea was to parse all
ls-R files which should work, but would be more work.
Is there a way to get all TeX source files or only the
ls-R files from
kpsewhich or another tool?
At best this should work for both TeX Live and MikTeX on all supported operation systems. However, my main target is TeX Live under Linux. As fall-back solution I would hard code the default paths and allow the user to change these using a configuration file.