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

Bug#374498: marked as done (debian-policy: please suggest #! / for "4 byte magic")

Your message dated Mon, 19 Jun 2006 15:29:53 -0500
with message-id <87odwoc2im.fsf@glaurung.internal.golden-gryphon.com>
and subject line This is not a bug.
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: debian-policy
Severity: wishlist

policy presently uses "#!/" without a space, but some systems
apparently require the space ("#! /") and sense the script "type"
using a 4-byte magic number.  info autoconf / "portable shell"
mentions this.  It would be nice to at least error on the side of
portability and suggest this instead of the current one (without a

--- End Message ---
--- Begin Message ---

        Actually, POSIX: The Open Group Base Specifications Issue 6
IEEE Std 1003.1, 2004 Edition Copyright © 2001-2004 The IEEE and The
Open Group, All Rights reserved., states:

        Another way that some historical implementations handle shell
        scripts is by recognizing the first two bytes of the file as
        the character string "#!" and using the remainder of the first
        line of the file as the name of the command interpreter to

        So it is only a two byte magic, which is what I recall. It
 gets even better: 
 2.1 Shell Introduction

The shell is a command language interpreter. This chapter describes
the syntax of that command language as it is used by the sh utility
and the system() and popen() functions defined in the System
Interfaces volume of IEEE Std 1003.1-2001. 

The shell operates according to the following general overview of
operations. The specific details are included in the cited sections of
this chapter. 

   1. The shell reads its input from a file (see sh), from the -c
      option or from the system() and popen() functions defined in the
      System Interfaces volume of IEEE Std 1003.1-2001. If the first
      line of a file of shell commands starts with the characters
      "#!", the results are unspecified. 

Men freely believe that what they wish to desire. Julius Caesar
Manoj Srivastava   <srivasta@debian.org>  <http://www.debian.org/%7Esrivasta/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C

--- End Message ---

Reply to: