weird Runtime.exec() problem
Posted on 2002-06-05
I need to run a command, basically:
Runtime rt = Runtime.getRuntime();
command = "dostuff -a blah -d \"blah blah\"";
Process p = rt.exec(command);
the second argument is the problem, for some reason the application treats the quoted argument as two separate ones and comlains that 'blah"' does not start with a '-'
if I echo this exact command and then copy and paste it from the shell, it works fine