While trying ProcessBuilder.start(), I wanted to figure out if it could parse special characters operators like &, | and < >
So, for example:
String[] cmdarray = new String[]{"whoami"};
Process p = new ProcessBuilder(cmdarray).start();
I get the result
But if I do:
String[] cmdarray = new String[]{"whoami", "&&", "uname", "-a"};
Process p = new ProcessBuilder(cmdarray).start();
I don't get any result.. is there any way to achieve that? Or is it a limitation of ProcessBuilder and Runtime.getRuntime().exec()?