Discussion:
Posix is silent; Open Group is silent; feature is SVR4 & 4.3+BSD
shivers-ss4n/k5RZhaUArH+
2001-03-21 20:14:39 UTC
Permalink
I've done some language-lawyering for this discussion.

I have sitting beside me the ISO/IEC 9945-1 ANSI/IEE Std 1003.1,
second edition 1996-07-12 Portable Operating System Interface (POSIX),
Part 1: System Application Program Interface (API) [C Language].

I have just looked up the exec syscalls. The spec says absolutely nothing
about #!. It's not a Posix feature.

The next level up the LCD chain seems to be the "Single (Unix) Spec."
Bengt checked it; I just rechecked it. It is also silent. Oh-kay.

I have subsequently checked Stevens. He claims (section 8.11) that
the "interpreter file" #! feature is SVR4 & 4.3BSD. He goes on to say that

- "The space between the exclamation point and the pathname is optional."

- "Be aware that many systems have a limit of 32 characters for the first
line of an interpreter file. This includes the #!, the pathname, the
optional argument, and any spaces."

The first point says that Marc's trick of separating #! and the interpreter
with a space should work, and is reasonably standard. (The union of SVR4 &
BSD is pretty broad.)

But the second point says that you better not count on > 32 chars, so making
the space *required* is painful.
-Olin
sperber-jNDFPZUTrfQQDnmTUQnR1uqEdJ8o/ (Michael Sperber [Mr. Preprocessor])
2001-04-30 13:20:43 UTC
Permalink
Olin> But the second point says that you better not count on > 32
Olin> chars, so making the space *required* is painful.

But this is only relevant if you're not using a trampoline. In that
case, you're system-specific anyway. Moreover, the restriction does
not seem to hold for most modern Unixes, including recent versions of
(as verified by us) FreeBSD, Linux, Solaris, AIX, HP-UX, Irix, and
MacOS X. In fact, I don't know a single current Unix version which
still has it.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
Loading...