delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/10/05:46:53

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: #! bash bug
Date: 10 Feb 2003 10:31:55 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 28
Message-ID: <b27v2r$gs1$1@nets3.rz.RWTH-Aachen.DE>
References: <200302082147 DOT h18Lljri034387 AT en26 DOT groggy DOT anc DOT acsalaska DOT net>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1044873115 17281 137.226.32.75 (10 Feb 2003 10:31:55 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 10 Feb 2003 10:31:55 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

abc AT anchorageinternet DOT org wrote:

> this does seem to be an ambiguous area, so, even after sleeping, i
> think it's more sane to allow arguments to a script given to an
> interpreter on the shebang line, passing everything after
> "#!/interpreter [arg]" to an "eval" or "sh -c" ...

As DJ already pointed out, this has nothing to do with bash.  #! is a
feature of the Unix kernel API.  

The ambiguity, if any, is one aspect of the big old cross-Unix
portability problem.  Different Unices behave ever so slightly
differently, in some of their core aspects, and this is one of them.
The core of the issue is that

	#! interpreter [_one_ optional argument]

is all you can really *rely* on, for a portable script, because that's
all the Unix standardization groups managed to agree on.  Some
platforms (including Linux, IIRC) will give your more flexibility, but
others won't, and the standards don't require them to.  DJGPP
apparently is in the latter group.  

Scripts that need more than this are essentially broken --- and it's
not DJGPP that broke them.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019