Possible Duplicate:
how to use multiple arguments with a shebang (i.e. #!)?
How can I make a #!
statement accept a param with arguments? It seems to be lumping them all together as one param instead of splitting on space as usual.
Take this contrived example:
$ cat /tmp/echo
#!/bin/echo -n
$ /tmp/echo
/tmp/echo$
works great and outputs the filename without a new line at the end. But this one:
$ cat /tmp/echo
#!/bin/echo -n hi
$ /tmp/echo
-n hi /tmp/echo
$
kills the -n
arg.
One hack I can do is make another shell script that just execs the first script I want with the params I want, but I'd rather not add extra dependancies if I don't need them.