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

  1. Submitted-by: jack@cwi.nl (Jack Jansen)
  2.  
  3. >  = trt@mcnc.org (Tom Truscott) writes:
  4. >> = C.R.Ritson@newcastle.ac.uk ("C.R. Ritson")
  5. >> The  danger  of direct interpretation by the shell is that the file is
  6. >> quite  likely  to  be  an  executable  object  file  for  some   other
  7. >> architecture  seen  from the wrong side of an NFS mount.  When this is
  8. >> the case the shell produces large numbers of "not found" messages  and
  9. >> often  ends  up  resetting  numerous operating modes.  Our newer users
  10. >> find this most confusing.
  11.  
  12. >If the kernel simply returned EACCES (for example) rather than ENOEXEC
  13. >when the file is non-ascii, the shells would not attempt interpretation.
  14. >(Just check that the first 4 characters have value > 1 and < 128.)
  15. >Dropping direct interpretation does make good sense.
  16. >But there is the problem of old kernels (e.g. System V.3.2!!) lacking #!,
  17. >and I think a surprising number of scripts will stop working
  18. >(such as /bin/true on some systems).  Serves them right I suppose.
  19.  
  20. I think you've missed the point here. The question is not wether the
  21. kernel recognizes #!, but wether the shell recognizes it.
  22.  
  23. Currently, when the kernel returns ENOEXEC the shell just blindly assumes
  24. that we have a shell script here and starts executing it. I don't see
  25. any problem in the shell reading the first line and checking it for
  26. #!/bin/sh.
  27.  
  28. The only thing that this would break is that old shell scripts without
  29. a #! first line wouldn't execute anymore, but this is trivial to fix
  30. by adding the #! line.
  31. -- 
  32. --
  33. Een volk dat voor tirannen zwicht    | Oral:     Jack Jansen
  34. zal meer dan lijf en goed verliezen    | Internet: jack@cwi.nl
  35. dan dooft het licht            | Uucp:     hp4nl!cwi.nl!jack
  36.  
  37.  
  38. Volume-Number: Volume 22, Number 78
  39.  
  40.