esql script missing shebang
Posted in 2007
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
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.
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