http://mail-index.netbsd.org/netbsd-users/2008/11/10/msg002390.html

Date: Sun, 9 Nov 2008 09:39:19 -0500 From: "matthew sporleder" <msporleder%gmail.com@localhost>
When the #! code was first written (by Dennis Ritchie, I was told, though I never asked him about it) all it allowed was a single path name to the interpreter - no extra args at all.

When I added it to BSD, I made a conscious decision to permit exactly one arg - not a general command line. That avoided the need for the kernel to contain an arg parser, or for any kind of quoting mechanism (I decided that allowing spaces in the interpreter path name was so unlikely to ever be required that we could just ignore that possibility - and no-one I know has ever complained about that one...).

Exactly one arg (or none) on the #! line remains the most common practice I believe, though I have heard of systems that have extended it. How they handle quoting issues I have no idea, I probably don't want to find out.

For what it is worth, I think the practice of using env is just laziness on the part of the developer of the script (not creating a mechanism to fill in the correct interpreter path when installing the script). It isn't needed with pkgsrc which does provide that mechanism.

Considering i've probably been professionally programming since before you were born, used multics and most *nix variants, even serving on the AIX dev team in Kingston AND since i know it is not the fault of env, i do realize YOU are the "self-impressed phony without a name attempting to put me down" here.

see also https://www.in-ulm.de/~mascheck/various/shebang/ and http://mail-index.netbsd.org/netbsd-users/2008/11/09/msg002388.html

The true solution to your problem is to create a script/program to initialize the proper environment that you expect and place that into a place that will be static across all systems. This is a solution used by all programmers that have worked in production shops as it is commonly REQUIRED for each application system delivered. I tend to place mine into /usr/bin, but on MVS they would exist in a proclib, and on VM/CMS on the application disk.

Edit:Ive been using Huck as a nickname on the net since the early 80's, first using Huck via HELPDESK@TAMVM1, before there was even a RELAY that IRC now uses as its middle name. It was given to me when i replaced Dave Berry as sound engineer on my HS stage crew, and i became Huck-TheNew-Berry when people came looking for him.


In reply to Re^9: shebang anomaly by huck
in thread shebang anomaly by perlboy_emeritus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.