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

From: Hansjoerg Lipp
Date: Mon Feb 23 2004 - 20:30:57 EST


On Mon, Feb 23, 2004 at 02:24:51PM -0800, Paul Jackson wrote:
> Hansjoerg wrote:
> > #!/bin/zsh -v -x
> > ...
> > this should be "evidence" enough(?)
>
> This testing was done on a system with your patch applied, right?

Yes. The results are the same if you use a stock kernel and call the
script manually.

> Because on a stock kernel, the various shells are of course
> confused by the "-v -x" argv[1].

Yes, of course.

> I will grant that ksh, bash, ash, tcsh and zsh are likely ok
> (willing to see > 1 option before the script file name.)
>
> An alternative way to test the same thing, that works even on
> a stock kernel:
>
> $ echo 'echo "$*"' > ./d
> $ ash -e -e ./d 1 2 3
> $ tcsh -v -v ./d 1 2 3
> $ zsh -e -e ./d 1 2 3
> $ ksh -e -e ./d 1 2 3
> $ bash -e -e ./d 1 2 3
>
> The thing being tested: will a shell handle > 1 option before a script
> file name. Each shell invocation of the "./d" script should echo the
> script file arguments "1 2 3".

This works as expected.

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/