Is a unicode byte order token valid at the beginning of a UNIX script file?

A #!at the beginning of the executable tells Unix / Linux shells to treat the file as a script, and the path to the interpreter for this script immediately follows #!.

Is it legal for Unicode byte order marks to appear at the beginning of such a script file before #!?

I understand that the particular interpreter to which the script will be passed will have to understand the sign of the byte order and process it correctly. My question is, is the part counted #!at the beginning of the file?

Of course, I could go and check what a particular shell does on a particular OS, but I am interested in the more general question of whether this is legal. If someone could link or point to a document that would be fantastic!

+4
source share
1 answer

Convert comments to response.

, ​​ #! shebang. , ; UTF-8, , , UTF-16 ( UTF-32) Unicode, - , . , - Unix; , , .

, script.

script UTF-16 (UTF-16LE UTF-16BE), script, ​​ ' ; :

interpreter script.name

script.name

( , , script). , , . script.name, #!, .

+1

Source: https://habr.com/ru/post/1622521/


All Articles