[lkml]   [2008]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectShebang - why are parameters not splitted on whitespace?

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
#!/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).


 \ /
  Last update: 2008-12-03 16:17    [W:0.114 / U:14.876 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site