Escape sequence in java
Posted on 2001-09-04
I have a problem in executing a command which takes parameters in double quotes. Seems like the following program is ignoring the double quotes, can any body help how this can be done in Java, I used to do these things in C using escape sequece (\" \").
String s = "";
s = new String ("/myfiles/command " + "-P");
Process p = Runtime.getRuntime.exec(s);
is getting executed on the command line as /myfiles/command -P instead of /myfiles/command "-P".
I tried "\"-P\"" and many combination like this unsucessfully.