home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / v22 / 079 / text0000.txt < prev   
Encoding:
Text File  |  1991-03-07  |  1.4 KB  |  31 lines

  1. Submitted-by: guy@auspex.uucp (Guy Harris)
  2.  
  3. >Currently, when the kernel returns ENOEXEC the shell just blindly assumes
  4. >that we have a shell script here and starts executing it. I don't see
  5. >any problem in the shell reading the first line and checking it for
  6. >#!/bin/sh.
  7.  
  8. Or checking for "#!" in general, and doing what is done in the "exec*()"
  9. implementations of many systems (usually in the kernel, but not
  10. necessarily so) - i.e., have the Bourne shell capable of executing C
  11. shell scripts (for those of you who write them :-)) that begin with "#!
  12. /bin/csh", and the C shell capable of executing Bourne shell scripts
  13. that begin with "#! /bin/sh", etc..
  14.  
  15. I don't strongly care where it's done (although I *do* prefer having
  16. "execl()" AND "execv()" capable of running scripts, even if it's done by
  17. having them be wrappers around kernel traps with the wrappers checking
  18. for the "#!" line if they get ENOEXEC), but it *would* be nice if the
  19. system didn't inappropriately try to run files that happened to have
  20. execute permissions as scripts if, in fact, they aren't scripts. 
  21.  
  22. I don't know if anything more should be said by any standard than simply
  23. "we do not guarantee that any shell will execute a script that doesn't
  24. begin with '#!'", so that you can remove the "if it gets ENOEXEC, treat
  25. it as a script" stuff and still comply with the appropriate POSIX
  26. standard(s).
  27.  
  28.  
  29. Volume-Number: Volume 22, Number 79
  30.  
  31.