nagios plugins compile problem on debian

Karl DeBisschop karl at debisschop.net
Sat Oct 5 03:13:21 CEST 2002


On Fri, 2002-10-04 at 08:42, Olaf Greis wrote:
> to me it would seem more important to actually use only sh syntax in the 
> scripts and not mixing it with bash syntax. on a linux system sh and bash are 
> often the same, but solaris, aix & friends use a sh != bash.

This has nothing to do with bash v. sh, sorry to be misleading. The
coding practice comes from autoconf docs, which has everything to do
with trying to work on as many platforms as possible. So, a little
poking around on the web gets me this URL:
http://www.uni-ulm.de/~s_smasch/various/shebang/

<blockquote>
Some specialities:

    * There is a rumor, that a very few and very special, earlier Unix
versions (particularly 4.2BSD derivatives) require you to separate the
"#!" from the following path with a blank. You may also read, that
(allegedly) such a kernel would parse "#! /" as a 32-bit (long) magic.

      But it turns out that it is impossible to find a Unix which
actually requires this.

      4.2BSD in fact doesn't, although the GNU autoconf tutorial wrongly
claims this (Portable Shell Programming).

      But instead, see again 4.0BSD /usr/src/sys/newsys/sys1.c, as well
as the first regular occurence in 4.2BSD, /usr/src/sys/sys/kern_exec.c.
The source (certainly) always accepted a blank, but never required it.

      All the above pointed out by Gunnar Ritter in
<3B5B0BA4.XY112IX2 at bigfoot.de> (and due to the new Caldera license, i
can reproduce the code here now.)

      Instead, the origin of this myth "of the required blank" might be
a particular version of 4.1 BSD, There is a manpage in a "4.1.snap"
snapshot of 4.1BSD on the CSRG CDs, /usr/man/man2/exec.2 (4/1/81), where
a space/tab after the "#!" is mentioned as mandatory. (Hint to such a
manpage from Bruce Barnett in <ae3m9l$rti$0 at 208.20.133.66>).

      All the above can give evidence that the myth is only based on a
bug in documentation.
</blockquote>
 
What the autoconf tutorial says is this:

<blockquote>
Also, include a space after the
exclamation point in interpreter specifications, like this:
     #! /usr/bin/perl
   If you omit the space before the path, then 4.2BSD based systems
(such as Sequent DYNIX) will ignore the line, because they interpret
`#! /' as a 4-byte magic number.
</blockquote>

Can anyone find an instance of Sequent DYNIX to test this?

> brdgs
>   olaf
> 
> Am Freitag, 4. Oktober 2002 12:38 schrieb Karl DeBisschop:
> > On Fri, 2002-10-04 at 02:31, Fredrik Wänglund wrote:
> > > The problem is that some of the scripts in the dir 'plugin-scripts' has
> > > an illegal first line wit an space in it; '#! /bin/sh'
> >
> > I have seen people suggest this a few times.
> >
> > GNU coding practice suggests using the space. It is required for a few
> > systems.
> >
> > Can you clearly show me how you come to the conclusion that is the
> > problem?
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list