Re: Script interpreter arguments

Guest section DW (dwguest@win.tue.nl)
Sun, 4 Jul 1999 02:08:51 +0200 (MET DST)


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.
See also fs/binfmt_script.c.

POSIX?
"Some systems can exec shell scripts. This functionality
is outside the scope of this document."

Andries

-
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/