home *** CD-ROM | disk | FTP | other *** search
- Submitted-by: guy@auspex.uucp (Guy Harris)
-
- >Currently, when the kernel returns ENOEXEC the shell just blindly assumes
- >that we have a shell script here and starts executing it. I don't see
- >any problem in the shell reading the first line and checking it for
- >#!/bin/sh.
-
- Or checking for "#!" in general, and doing what is done in the "exec*()"
- implementations of many systems (usually in the kernel, but not
- necessarily so) - i.e., have the Bourne shell capable of executing C
- shell scripts (for those of you who write them :-)) that begin with "#!
- /bin/csh", and the C shell capable of executing Bourne shell scripts
- that begin with "#! /bin/sh", etc..
-
- I don't strongly care where it's done (although I *do* prefer having
- "execl()" AND "execv()" capable of running scripts, even if it's done by
- having them be wrappers around kernel traps with the wrappers checking
- for the "#!" line if they get ENOEXEC), but it *would* be nice if the
- system didn't inappropriately try to run files that happened to have
- execute permissions as scripts if, in fact, they aren't scripts.
-
- I don't know if anything more should be said by any standard than simply
- "we do not guarantee that any shell will execute a script that doesn't
- begin with '#!'", so that you can remove the "if it gets ENOEXEC, treat
- it as a script" stuff and still comply with the appropriate POSIX
- standard(s).
-
-
- Volume-Number: Volume 22, Number 79
-
-