Subject: NetBSD, the scotty pkg, and #!
To: None <tech-pkg@netbsd.org>
From: None <Havard.Eidnes@runit.sintef.no>
List: current-users
Date: 06/14/2000 19:33:01
Hi,

I've recently bumped into an unpleasantness with the scotty
package.  Our package installs the following script as
/usr/pkg/bin/scotty:

#!/bin/sh
export TCLLIBPATH=3D"/usr/pkg/lib/tnm2.1.8"
exec /usr/pkg/bin/scotty2.1.8 $*

This becomes a problem when I try to run some of my scotty
scripts (which previously through a local installation pointed
directly to the real executable) with

#!/usr/pkg/bin/scotty

What ends up happening is that the scotty (tcl) code gets fed to
the Bourne shell -- not exactly a great recipe for success.

Apparently, NetBSD's execve(2) manual page does not document the
same restriction as Solaris' execve(2) page does, namely:

     An interpreter file begins with a line of the form

          #! pathname [arg]

     [...] The interpreter named by pathname
     must not be an interpreter file.

although the same restriction seems to apply in NetBSD's case.

So, I would suggest the following:

a) That the scotty wrapper script instead be turned into a real
   program written in C doing the same thing as above, or that
   the default TCLLIBPATH be compiled into the "real" scotty
   executable.

b) That someone knowledgeable verify whether the restriction of
   "double interpreters" is sensible to keep, and if it is, fix
   the documentation to point this out.

Comments?

- H=E5vard