J
jaideep.barde
Hi Gurus,
I want to execute a command consisting of couple of "|" pipes in it.
For e.g. "dir | grep gpc | grep -v 25". So did this like,
String cmd = "dir | grep gpc | grep -v 25";
Process p = Runtime.getRuntime().exec(cmd);
.....
.....
However, I get the output of this execution is only till first pipe!
that is, I see the output of "dir | grep gpc" only the rest "grep -v
25" command does not get into act.
Does the pipe when used in Runtime.exec work something different? Am I
doing somthing wrong here? I'm doing this on windows (NT) but will also
be using the code in UNIX so would there be any problems?
Thanks in advance for any types of pointers.
~jaideep
I want to execute a command consisting of couple of "|" pipes in it.
For e.g. "dir | grep gpc | grep -v 25". So did this like,
String cmd = "dir | grep gpc | grep -v 25";
Process p = Runtime.getRuntime().exec(cmd);
.....
.....
However, I get the output of this execution is only till first pipe!
that is, I see the output of "dir | grep gpc" only the rest "grep -v
25" command does not get into act.
Does the pipe when used in Runtime.exec work something different? Am I
doing somthing wrong here? I'm doing this on windows (NT) but will also
be using the code in UNIX so would there be any problems?
Thanks in advance for any types of pointers.
~jaideep