Re: Script interpreter arguments

Khimenko Victor (khim@sch57.msk.ru)
Sun, 4 Jul 1999 04:18:34 +0400 (MSD)


On Sun, 4 Jul 1999, Guest section DW wrote:

> From: "Khimenko Victor" <khim@sch57.msk.ru>
>
> It's possible to specify optional argument to interpreter in script:
> -- cut --
> #!/usr/bin/perl -w
> -- cut --
> but not possible to specify two arguments
> -- cut --
> #!/usr/bin/eperl -B=<!--eperl -E=-->
> -- cut --
>
> Why ? It's very annoying :-(( What POSIX says on subject ?
>
> Why?
>
> It is like this: if you have a script called bar, that starts with
>
> #!/some/patch/foo lots of arguments
>
> and the script is invoked using
>
> /some/other/path/bar
>
> then the program /some/patch/foo is called with precisely three arguments:
> 0: "foo"
> 1: "lots of arguments"
> 2: "/some/other/path/bar"
>
> In other words: a space does not separate arguments here.
>
I know this. I even know what and where I can change to fix this (forgot
to mention this in original message, sorry). I wonder why it whas
developed this way...

> See also fs/binfmt_script.c.
>
I seen. I was biten by this feature quite a few times and NEVER seen
script where argument with spaces are usefull. I'm not ask "why so
happens". I'm ask "why it's done this way" ?

>
> POSIX?
> "Some systems can exec shell scripts. This functionality
> is outside the scope of this document."
>
Ok. If POSIX says nothing we should ask: what other unix'es doing ?

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