FULL PRODUCT VERSION :
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Linux akksw01-I38434 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
on linux platform the command line argument having double quotes are not recognised or are not passed to the command appropriately
the problem is not occuring for windows platform it occurs for linux
i don't know about other platforms.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.io.IOException;
public class Quotes {
public static void main(String[] args) {
String command = "mkdir " + "\"/home/\\\"Test\\\"\"";
System.out.println(command);
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
}
On linux platform this program doesn't work but works on windows platform
the above programs executes with no error but does not craete a directory with name "Test" Note the double quotes are the part of the name
but executing the command - mkdir "/home/\"Test\""
directly on linux shell will create the directory
the runtime .exec is not able to parse the argument with double quotes properly
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
following directory should be created
/home/"Test"
ACTUAL -
no directory was created
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
public class Quotes {
public static void main(String[] args) {
String command = "mkdir " + "\"/home/\\\"Test\\\"\"";
System.out.println(command);
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround found, please provide if possible from your side.
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Linux akksw01-I38434 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
on linux platform the command line argument having double quotes are not recognised or are not passed to the command appropriately
the problem is not occuring for windows platform it occurs for linux
i don't know about other platforms.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
import java.io.IOException;
public class Quotes {
public static void main(String[] args) {
String command = "mkdir " + "\"/home/\\\"Test\\\"\"";
System.out.println(command);
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
}
On linux platform this program doesn't work but works on windows platform
the above programs executes with no error but does not craete a directory with name "Test" Note the double quotes are the part of the name
but executing the command - mkdir "/home/\"Test\""
directly on linux shell will create the directory
the runtime .exec is not able to parse the argument with double quotes properly
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
following directory should be created
/home/"Test"
ACTUAL -
no directory was created
ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
public class Quotes {
public static void main(String[] args) {
String command = "mkdir " + "\"/home/\\\"Test\\\"\"";
System.out.println(command);
try {
Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
no workaround found, please provide if possible from your side.