ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Nerun on May 29, 2024, 09:32:51 AM

Title: ENV scripts [suggestion]
Post by: Nerun on May 29, 2024, 09:32:51 AM
Using libimage-exiftool-perl version 12.40 in Linux Mint 21.3.

When i use exiftool in a script with shebang #!/usr/bin/env <excutable>, the exiftool read it as an env script not <executable> script.

#!/usr/bin/env python3
print("Hello World!")

ExifTool Version Number         : 12.40
File Name                       : Python.py
Directory                       : .
File Size                       : 45 bytes
File Modification Date/Time     : 2024:05:29 10:30:32-03:00
File Access Date/Time           : 2024:05:27 14:12:12-03:00
File Inode Change Date/Time     : 2024:05:29 10:30:32-03:00
File Permissions                : -rwxrwxr-x
File Type                       : env script
File Type Extension             :
MIME Type                       : text/x-env

Would not be better identify it as Python 3 script? Or, even better:

File Type                       : env script / python script
File Type Extension             :
MIME Type                       : text/x-env / text/x-python3

Also, File Type Extension is empty. Should be "py"?
Title: Re: ENV scripts [suggestion]
Post by: Phil Harvey on May 29, 2024, 10:06:55 AM
I don't know if ExifTool should be changed here.  Presumably it would have knowledge about the "env" argument format and parse all arguments to determine the utility that is being run.   If it did this for "env", it should do this for other similar utilities.  I see this as being a rabbit hole that I don't want to venture into.

- Phil