[ale] help please getting script file to work
Michael H. Warfield
mhw at WittsEnd.com
Thu Feb 16 10:59:53 EST 2012
On Thu, 2012-02-16 at 00:46 -0500, Michael Potter wrote:
> On Wed, Feb 15, 2012 at 10:49 PM, Jim Kinney <jim.kinney at gmail.com> wrote:
> > I don't know the history behind the syntax of #!/bin/sh but it won't work
> > without it!
> http://en.wikipedia.org/wiki/Shebang_(Unix)
> The most interesting part of the article is how the shebang is a magic
> number that by design is human readable.
Having lived through that era, I agree with the vast majority of that
article. For the most part, all Unix systems I worked on (SCO Unix, SCO
Xenix, SunOS 3 and 4, Solaris, and MassComp 5600 AT&T Unix, BSD) all
interpreted a script such that if it had a #! it was honored and if
there was none, the Bourne Shell, sh, was involved. IIRC, back then,
this was not handled as a executable "magic number" to the OS as it is
today, but merely implemented in the various shells. So for sh, it was
optional. For csh (C Shell) and ksh (Korn Shell) scripts it was
mandatory unless you invoked the interpreter manually. That's still
true to this day but now the #! (which we always pronounced "hash-bang"
or "hash-pling" [SCO] - this is the first I have ever seen it referenced
as shebang) is interpreted at a much lower level in the OS. Including
it, might speed up execution a bit faster because the system knows
immediately what interpreter to use instead of having to test for every
magic number it knows and then take the default. The thing about it
being a comment was originally explicitly so that the original Bourne
Shell would ignore it.
> --
> Michael Potter
> Tapp Solutions, LLC
> Replatform Technologies, LLC
> +1 770 815 6142 ** Atlanta ** michael at potter.name **
> www.linkedin.com/in/michaelpotter
Regards,
Mike
--
Michael H. Warfield (AI4NB) | (770) 985-6132 | mhw at WittsEnd.com
/\/\|=mhw=|\/\/ | (678) 463-0932 | http://www.wittsend.com/mhw/
NIC whois: MHW9 | An optimist believes we live in the best of all
PGP Key: 0x674627FF | possible worlds. A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20120216/29192e7f/attachment.bin
More information about the Ale
mailing list