かなり前のことなので記憶が曖昧ですが、 「#! とパスの間にはスペースを空けるべき!」 みたいな主張を読んで(実際に著名な方がそういう scripts を書いていたということもあり)、そのように習慣づけていたのですが...
The #! magic - details about the shebang mechanism (下線は引用者による)Blank after #! required? There is a rumor, that a very few and very special, earlier Unix versions (particularly 4.2BSD derivatives) require you to separate the "#!" from the following path with a blank. You may also read, that (allegedly) such a kernel parses "#! /" as a 32-bit (long) magic. But it turns out that it is virtually impossible to find a Unix which actually required this. ... There is a manpage in a "4.1.snap" snapshot of 4.1BSD on the CSRG CDs, /usr/man/man2/exec.2 (4/1/81), where a space/tab after the #! is mentioned as mandatory. However, this is not true: the source itself remained unchanged.
Blank forbidden? I found no evidence yet, that there's an implementation which forbids a blank after #! ということで、根拠の無い噂だったみたい。でも、これによって動かない実装系は無いようなので、まぁいいかという感じです。これから新しく書くモノでは気をつけよう。
|