[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] help please getting script file to work
- Subject: [ale] help please getting script file to work
- From: lists at serioustechnology.com (Geoffrey Myers)
- Date: Thu, 16 Feb 2012 13:09:59 -0500
- In-reply-to: <[email protected]>
- References: <[email protected]> <CAEo=5Pxa8m1D2GJGN3vULbaKRrN8HXY1QE_M9w+ThoAkGWOOkA@mail.gmail.com> <[email protected]> <CACUD18ouZ6As7kmt=ZequY62D6-MoG3Dcqf6=pX1ghJH0pn5dw@mail.gmail.com> <[email protected]> <CAEo=5PwJhXUjpbwHPUXnV1OCEWqZO04nfzdGwTc7zp=EYZe08Q@mail.gmail.com> <CAEKW2OJsvYoyTJ=Z+CE-MP-syAq_-=ZPR6-L51GeKu8pbiqMVg@mail.gmail.com> <[email protected]>
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