URGENT: bash positional parameters
Posted on 2003-11-26
I'm writing a script for launching java-application. It should pass all the parameters to java:
$JAVA_HOME/bin/java -cp . MyAppplication $*
This works fine if all the arguments consist of one word. But there's a problem for multiple words:
./myscript 'hello world'
$* gives hello world striping off the quotes. It means that java gets two arguments instead of one. If I launch java directly it works fine:
$JAVA_HOME/bin/java -cp . MyApplication 'hello world'
This gets one argument, exactly what I need.
How can this be solved? How can I leave quotes when passing arguments to java?
Thanks in advance!