Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Gerardo Santana asked why the esql script has no shebang line. Jonathan Leffler said the leading colon was used because #! was once unreliable across platforms, and that #!/bin/sh would now be sensible. Carsten Haese noted the colon works on his systems. Santana, on Solaris, saw an error invoking esql from Ruby and worked around it with env, likely a Ruby bug.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
On Sun, 2007-10-21 at 05:51 +0000, Gerardo Santana wrote:
> Is there any good reason for not including the shebang at the top of
> the esql script?
>
> I was surprised about that a year ago. I had to work around it.
What OS are you on, what *is* at the top of your esql script, and how
did you work around it?
The esql script on my computer starts with a colon, and all platforms I
have access to (Linux, SCO, Solaris) recognize files that start with a
colon and have 'x' permission as shell scripts.
--
Carsten Haese
http://informixdb.sourceforge.net
On Oct 20, 10:51 pm, Gerardo Santana <gerardo.sant...@gmail.com>
wrote:
> Is there any good reason for not including the shebang at the top of
> the esql script?
>
> I was surprised about that a year ago. I had to work around it.
The 'good reason' is an ancient one -- it (the #!/bin/sh shebang) used
not to work reliably on all platforms, once upon a decade or two ago,
and since the ':' notation worked on all machines, that was more
reliable.
Sometime during the last decade or so, there began to be occasional
problems with systems that didn't pay proper attention to the ':' at
the start -- which platform, and which shell are you using that causes
you to have to worry about it?
It would, now, be more sensible to replace the traditional ':' with
the #!/bin/sh. Since POSIX mandates that there is a shell called /bin/
sh and it is a superset of the Bourne shell, there should be no
problems -- the scripts don't do anything complicated enough to be
likely to run foul of the differences.
On Oct 21, 8:51 am, Jonathan Leffler <jonathan.leff...@gmail.com>
wrote:
> On Oct 20, 10:51 pm, Gerardo Santana <gerardo.sant...@gmail.com>
> wrote:
>
> > Is there any good reason for not including the shebang at the top of
> > the esql script?
>
> > I was surprised about that a year ago. I had to work around it.
>
> The 'good reason' is an ancient one -- it (the #!/bin/sh shebang) used
> not to work reliably on all platforms, once upon a decade or two ago,
> and since the ':' notation worked on all machines, that was more
> reliable.
It's great to have you around to give us, newcomers (late 90s), some
history, first hand.
I didn't know about that.
>
> Sometime during the last decade or so, there began to be occasional
> problems with systems that didn't pay proper attention to the ':' at
> the start -- which platform, and which shell are you using that causes
> you to have to worry about it?
To reply to you and Carsten, I'm working on Solaris/sparc64. Invoking
esql from Ruby was giving me an error, as if it were not executable. I
worked around it using env, as you can see in ext/extconf.rb.
It's probably a Ruby bug, since Python and Perl has no problems with
that.
>
> It would, now, be more sensible to replace the traditional ':' with
> the #!/bin/sh. Since POSIX mandates that there is a shell called /bin/
> sh and it is a superset of the Bourne shell, there should be no
> problems -- the scripts don't do anything complicated enough to be
> likely to run foul of the differences.
That would be nice.
Thank you Jonathan.
--
Gerardo Santana
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.