Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!ukc!axion!masalla.fulcrum.bt.co.uk!beta.its.bt.co.uk!tjo From: tjo@its.bt.co.uk (Tim Oldham) Newsgroups: comp.lang.perl Subject: Re: #! troubles Message-ID: <0YRS3=@masalla.fulcrum.bt.co.uk> Date: 17 Jan 90 15:22:28 GMT References: <1970@uvaarpa.virginia.edu> Sender: root@fulcrum.bt.co.uk (Root on Masalla) Organization: BT Applied Systems, Birmingham, UK Lines: 22 In article <1970@uvaarpa.virginia.edu> worley@compass.com writes: >The *real* solution for this problem is to have the kernel search your >path when it sees a #!. Otherwise, you have to be root to install a >new interpreter in the "standard" place, because the #!'s have the >interpreter's location hardcoded in. On our machines - made by BT and running V.3.2 - we didn't have #!. Since I run bash as my login shell, I hacked the code to support #!. I did it the lazy way and let bash start up fully, and then execvp() the interpreter a la BSD. Just needs a few hooks in the lexical analyser, a new yacc rule, and the actual code to execvp as necessary. This of course is inefficient, as bash starts up fully only (all the initialisation etc) to execvp whatever interpreter is necessary. This actually means that the #! is recognised wherever it happens to be, as long it's at the beginning of a line. Not much use, tho'. The use of execvp means that you get path searching. Tim. -- Tim Oldham, BT Applied Systems. tjo@its.bt.co.uk or ...!ukc!axion!its!tjo Less is more, but not as much as more.