#! Processing Problem

Joseph Boykin boykin at calliope.Encore.COM
Fri Apr 14 03:36:37 AEST 1989


In article <7915 at vdsvax.steinmetz.ge.com> lorensen at 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 at encore.com



More information about the Comp.unix.questions mailing list