[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Posix is silent; Open Group is silent; feature is SVR4 & 4.3+BSD

This page is part of the web mail archives of SRFI 22 from before July 7th, 2015. The new archives for SRFI 22 contain all messages, not just those from before July 7th, 2015.

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.