[File] TCL modulefiles not flagged as "text"

Rowan Worth rowanw at dug.com
Fri Mar 27 07:44:56 UTC 2026


Hi all,

In the docs for file(1) we have:

Users depend on knowing that all the readable files in a directory have the
> word “text” printed.  Don't do as Berkeley did and change “shell commands
> text” to “shell script”.
>

Which is indeed a well-loved behaviour! However, /bin/file appears to have
done exactly that for modulefiles. Eg. examining the same file from two
different systems:

(1) Older Centos 7 machine

$ file --version
file-5.11
magic file from /etc/magic:/usr/share/misc/magic
$ file ./teamhpc
./teamhpc: ASCII text

(2) Newer Rocky 9 machine

$ file --version
file-5.39
magic file from /etc/magic:/usr/share/misc/magic
$ file ./teamhpc
./teamhpc: modulefile

Modulefiles are effectively TCL code so I believe the "text" category is
justified, and indeed the reason I noticed this is because I have another
script using file(1) which relies on this label :)

The responsible change is from 2019 <
https://github.com/file/file/commit/acc55b97>, which I believe was first
released in file-5.38? Can the magic file be updated so the description
includes "text" once again?

Cheers,
-Rowan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/file/attachments/20260327/0a442d2c/attachment.htm>


More information about the File mailing list