Linux #! incompatibility?

Matthias Andree matthias.andree at gmx.de
Wed Dec 4 19:21:56 CET 2002


David Relson <relson at osagesoftware.com> writes:

> Attached is a tarball with output from my 3 Mandrake 8.2/9.0 machines
> running 2.4.18-6mdk (stock & custom kernels) and 2.4.19-16mdk (stock).
>
> Given the "invalid option ... GNU long option" message, isn't this more
> likely a /bin/sh issue, rather than a kernel issue?

Not here, looking at the kernel source, it splits out the interpreter
field (/bin/sh) and passes the rest of the line as single opaque
argument to the interpreter, so if I write

#!/bin/sh -- blah

the kernel does the equivalent of

{
        char *argv[3];
        argv[0] = "/bin/sh";
        argv[1] = "-- blah";
        argv[2] = 0;
        execve(argv[0], argv, environ);
        /* error handling here */
}

-- 
Matthias Andree




More information about the bogofilter-dev mailing list