[ale] help please getting script file to work
Geoffrey Myers
lists at serioustechnology.com
Thu Feb 16 13:09:59 EST 2012
Michael H. Warfield wrote:
> 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.
I had to test this to be sure as I was under the understanding that if
you did not have a #! line, that the script would be executed by the
parent shell, not necessarily sh. I use ksh and I wrote a small script
that uses a kshism that is not supported by bash. Sure enough, it works
fine without the !# when run from my ksh terminal.
The one liner I wrote uses 'print' rather then 'echo' in the script.
With a #!/bin/sh I get an error, without out it, it runs fine.
--
Until later, Geoffrey
"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson
More information about the Ale
mailing list