Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!encore!calliope!boykin From: boykin@calliope.Encore.COM (Joseph Boykin) Newsgroups: comp.unix.questions Subject: Re: #! Processing Problem Message-ID: <5968@xenna.Encore.COM> Date: 13 Apr 89 17:36:37 GMT References: <7915@vdsvax.steinmetz.ge.com> Sender: news@Encore.COM Reply-To: boykin@calliope.UUCP (Joseph Boykin) Organization: Encore Computer Corp, Marlboro, MA Lines: 38 In article <7915@vdsvax.steinmetz.ge.com> lorensen@dwaskill.uucp (Bill Lorensen) writes: >Sorry if this is a known problem, but here goes. > >Any program can be invoked to process an interpreter script by putting >the program name on the first line of a script preceeded by a #!. This >is most often used to invoke a shell such as /bin/csh or /bin/sh. >However, I think I have discovered (probably rediscovered) a bug in >first line processing. There appears to be a hard limit on the length >of the path name. This is 29 characters on a Sun3. I have also found >the same problem on: > > Sun4, Convex C220, Encore Multimax, Stellar GS1000 > >This seems to happen regardless of the shell you are running. I >suspect the first line processing is handled directly by execve. I don't remember this being documented anywhere, but you are exactly correct when you say that this is handled directly by execve. Under 4.3BSD (amont others, include our own MACH implementation) there is a constant called "SHSIZE" defined as 32. Subtract off two for "#!" and one for '\n' and you're down to the 29 characters you've noticed. I wouldn't really call this a bug, more a poor choice of size limitations. It would certainly be easy enough to up this limit; the kernel code would allow just about any reasonable value. In the meantime, it is hard coded and without kernel sources you're not going to be able to change it. ---- Joe Boykin Encore Computer Corp Vice-Chair, IEEE Computer Societies' Technical Activities Board UUCP: encore!boykin ARPA: boykin@encore.com