Hi,
I'm newbie of Java and I have a trouble on executing a command of shell where I use a pipe. I read on the web that it is possible to do something like this:
This works well. If I try something more complex like thisCode:String[] cmd = { "/bin/sh", "-c", "ls /etc | grep release" }; Process p = Runtime.getRuntime().exec(cmd);
it does not work and I receive the exit code 255. Do you have any idea?Code:ssh user@ip 'tar -jcf - file1 file2 ' | tar -C /path -jxf -
Thank you
Bookmarks