when I try to command in command line it executes fine
$: /application/jre/bin/java -classpath /application/common/lib/apps.jar: ./updater.jar com.application.updatermain mobile
This executes perfectly fine and returns me the results whereas when I try putting this in a file called run.sh
If I create a run.sh as
/application/jre/bin/java -classpath /application/common/lib/apps.jar: ./updater.jar com.application.updatermain $@
and try to run it
./run.sh mobile
it acts weird
My java code:
if (args.length == 1) {
if (args[0].equalsIgnoreCase("mobile") ) {
updateDB = true;
} else {
System.out.println(" 1 :Usage: ./run.sh [mobile] "+ args[0]);
return;
}
}
It gives me the output
1 :Usage: ./run.sh [mobile] mobile
Am I missing anything here.
Thanks a lot
$@in quotes.args(not onlyargs[0])?