With bash, how can I pipe standard error into another process?
问题 It's well known how to pipe the standard ouput of a process into another processes standard input: proc1 | proc2 But what if I want to send the standard error of proc1 to proc2 and leave the standard output going to its current location? You would think bash would have a command along the lines of: proc1 2| proc2 But, alas, no. Is there any way to do this? 回答1: There is also process substitution. Which makes a process substitute for a file. You can send stderr to a file as follows: process1 2