Update executePipeBatch. Not working

It was a mess!!! I can't copy from the outputstream of cmd1 to inputstream of cmd2