Re: [PATCH] Linux 2.6: shebang handling in fs/binfmt_script.c

From: Hansjoerg Lipp
Date: Mon Feb 23 2004 - 20:33:43 EST


On Mon, Feb 23, 2004 at 02:00:27PM -0800, Paul Jackson wrote:
> Hansjoerg wrote:
> > I still don't understand your argument... If there is a shell having
> > those problems, nobody would use something like
>
> I will acknowledge that while one _could_ code a shell so that your
> proposed change would break it, it would be a stupid, silly and ugly
> way to code a shell.
>
> That is, one _could_ code a shell to say:
>
> 1) If argv[1] starts with a '-', consume and handle as an option
> (or possibly as a space separated list of options).
> 2) Presume the next argument, if any, is a shell script file.

There is no problem with such a shell if you use scripts beginning with

#!/some/shell

or

#!/some/shell -some_arg

if some_arg does not contain whitespace characters. In both cases,
argv will be the same as it is with the current code.

/some/script param1 param2

will become

/some/shell /some/script param1 param2

or

/some/shell -some_arg /some/script param1 param2

as it has been before.

There is a problem with a shebang line like

#!/some/shell -x -y

_but_ this was most probably an error, before. (Unless this shell
accepts _one_ parameter "-x -y" containing a space.)

So, I really can't see any problem with such a shell...

Regards,

Hansjoerg Lipp
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/