_D_
asked on
weird Runtime.exec() problem
I need to run a command, basically:
Runtime rt = Runtime.getRuntime();
command = "dostuff -a blah -d \"blah blah\"";
Process p = rt.exec(command);
p.waitFor();
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
any suggestions?
Runtime rt = Runtime.getRuntime();
command = "dostuff -a blah -d \"blah blah\"";
Process p = rt.exec(command);
p.waitFor();
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
any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER