[File] file v5.41 -- double space in some descriptions

B Watson yalhcru at gmail.com
Tue Feb 8 18:21:37 UTC 2022

On 1/24/22, J G Miller <jgmiller at pt.lu> wrote:
> The expected output is "...a /usr/bin/..." with a single space.
> Presumably this double spacing is not intentional since it does not
> always occur and it makes checking the output more complex, viz the
> necessity of adding "[[:space:]][[:space:]]*" to regular expressions
> to parse the output.

It looks like file is just printing everything after the #! characters.
It's perfectly OK for a script to look like this:


Or this:

#! /bin/whatever

Or even this:

#!     /bin/whatever

Whether or not there's a space there, or how many spaces, is entirely
up to whoever wrote the script. The kernel doesn't care, so it's
basically a stylistic thing, some authors think it's more readable
with the space, others don't.

So what file prints depends on the actual line in the script it's
looking at. Not sure if this is intended behaviour, but at least it's

More information about the File mailing list