Subject: Re: misc/23729: Syntax error: "(" unexpected
To: None <gnats-bugs@NetBSD.org, netbsd-bugs@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: netbsd-bugs
Date: 10/09/2006 21:59:13
On Sun, 08 Oct 2006, Christos Zoulas wrote:
> |  The behavior exhibited by sh and ksh is historic, but hasn't been
> |  useful since #! was invented, which was a long time ago.
> |  
> |  Probably the best thing to do is to remove it.
> 
> And what happens to shell scripts that don't start with #!?

If you tell the shell to treat them as scripts, via 'sh filename', they
should work.  If you tell the shell to exec them, via 'sh -c filename'
or just 'filename' from inside a shell, then I think you should get an
exec failure, just as if you did execlp("filename", "filename", NULL).

--apb (Alan Barrett)