mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Shebang - why are parameters not splitted on whitespace?
@ 2008-12-03 15:14 Geralt
  2008-12-03 15:56 ` Américo Wang
  0 siblings, 1 reply; 7+ messages in thread
From: Geralt @ 2008-12-03 15:14 UTC (permalink / raw)
  To: linux-kernel

Hi,

I've just noticed, that it's not possible to use more than one
parameter in a shebang on linux, because everything following the
executable path in the shebang is treated as one parameter, so for
example
#!/bin/awk --re-interval -f
in a script called "test.awk" results in a call likes this:
/bin/awk "--re-interval -f" ./test.awk
when running it with "./test.awk".

Is there any reason why the parameters are not split before passing
them on to the program?
I mean we're talking here about linux where every program starts
somewhere with int main( int argc, char* argv[]), i.e. the arguments
are given piecewise, not in one big string (as it is the case for
win32 applications), so I was very surprised at first why my snipped
from above did not work and I suppose a lot of people would expect it
to behave in the natural way (= splitting the arguments).




Geralt.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-12-06 21:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-03 15:14 Shebang - why are parameters not splitted on whitespace? Geralt
2008-12-03 15:56 ` Américo Wang
     [not found]   ` <fbdd0e50812030929q65d2e805y49094dd67209be7e@mail.gmail.com>
2008-12-03 17:29     ` Geralt
2008-12-06  1:04       ` Américo Wang
2008-12-06  5:41         ` Valdis.Kletnieks
2008-12-06 12:02           ` Geralt
2008-12-06 21:14             ` Aaron Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®