Subject: Re: Changing exec's #! behavior
To: None <>
From: Christos Zoulas <>
List: tech-kern
Date: 06/13/2000 21:32:09
In article <>,
Jason R Thorpe <> wrote:
> env(1) subsequently complains that it cannot exec "perl -w" because it
> doesn't exist.
> Now, the reason that the -w is seen by perl in the Solaris case is
> because perl *itself* looks at the script for a line that has "#!" and
> "perl" in it, and upon finding it, parses the command line args to
> perl located there itself.
> I've changed NetBSD's exec_script.c to have the Solaris behavior and
> am using it that way in our environment here.  But I'd like to get
> comments on this before I commit the change to the master NetBSD
> sources.

Now I suddenly cannot use an interpreter that has a space in its
filename. What should the kernel do next? Start parsing backslash
and quotes? Then hmm, maybe #!/bin/sh -c echo *.c should be expanded
by the kernel too. Well, I do agree that it is a cute hack that
works in the perl case, but given that the user has control over
the perl script and can turn -w himself on, why change things?
Plus if it only works on Solaris, then we should be following the
general trend, not Solaris.