in reply to Re: error while piping outputin thread error while piping output
2&1 does not redirect. Did you mean 2>&1 (note the additional greather-than sign)?