From mboxrd@z Thu Jan 1 00:00:00 1970 From: cowan@mercury.ccil.org (John Cowan) Date: Mon, 17 Jan 2011 15:47:18 -0500 Subject: [TUHS] History of #! interpretation in Unix In-Reply-To: <4D346FD6.7070103@bsdimp.com> References: <20110116084330.GA27396@minnie.tuhs.org> <20110116095548.GC3374@mercury.ccil.org> <20110116132039.GA16484@lisa.in-ulm.de> <20110116171715.GD3374@mercury.ccil.org> <20110116191942.GA26424@lisa.in-ulm.de> <20110116201745.GE3374@mercury.ccil.org> <20110116210812.GB26424@lisa.in-ulm.de> <20110116213738.GG3374@mercury.ccil.org> <4D346FD6.7070103@bsdimp.com> Message-ID: <20110117204717.GH2461@mercury.ccil.org> Warner Losh scripsit: > The alternatives are worse. You're making my point for me. > On a sysIII system, you had the situation where scripts would be > executed by whatever your shell. So if you put a script on the system, > you had to make sure everybody used csh and write it in csh, or you had > to make sure nobody did and write it in /bin/sh. Right. > The current situation says that 'you must opt-in' to a different shell, > which leads to more predictable behavior. Unfortunately not. The current situation is that when a shell sees a shebang-free script, it decides whether it is Posix enough to execute that script. So ash, bash, dash, ksh, zsh will all run shebang-free scripts themselves, whereas csh, tcsh will defer to /bin/sh. What I am arguing for is that *all* shells should defer to /bin/sh to execute shebang-free scripts. As things stand, the behavior of a shebang-free script depends on which shell is trying to run it, whereas it should only depend (says I) on the identity of /bin/sh. > Later, #! processing moved into the kernel so that interpreters would > execute things directly. Yes, and that's a Good Thing. -- The experiences of the past show John Cowan that there has always been a discrepancy cowan at ccil.org between plans and performance. http://www.ccil.org/~cowan --Emperor Hirohito, August 1945