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

Christos Zoulas christos at zoulas.com
Tue Feb 15 16:08:01 UTC 2022


Yes, but it is nice to be consistent so I just did:

Index: commands
===================================================================
RCS file: /p/file/cvsroot/file/magic/Magdir/commands,v
retrieving revision 1.66
diff -u -u -r1.66 commands
--- commands    3 Jul 2021 13:50:29 -0000       1.66
+++ commands    15 Feb 2022 16:07:02 -0000
@@ -98,7 +98,7 @@
 !:mime text/x-shellscript

 0      string/wt       #!\     a
->&-1   string          x       %s script text executable
+>&-1   string/T        x       %s script text executable

 0      search/1/fwt    #!\ /usr/bin/tclsh      Tcl/Tk script text executable
 !:mime  text/x-tcl


christos

> On Feb 8, 2022, at 1:21 PM, B Watson <yalhcru at gmail.com> wrote:
> 
> 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:
> 
> #!/bin/whatever
> 
> 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
> explainable.
> --
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20220215/3701be8e/attachment.asc>


More information about the File mailing list