Redirecting StdOut And StdErr
Published on 30 Nov 2007Tags #Bash
In case you would ever like to process standard output and standard error separately:
{
echo stdout
echo stderr >&2
} 2> >(cat > stderr) > >(cat > stdout)
NOTE: The output is not synchronized line-wise. So redirecting both lines of processing into the same file (using >>
) will cause the individual results to be garbled.
Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.