Wednesday, October 16, 2013

Piping stderr

To pipe stderr (instead of stdout) use `|&' instead of `|'. This works from Bash 4 onwards. It is shorthand for `2>&1 |', which redirects bytes sent to stderr (2) to stdout (1), and then pipes it (|).

[Courtesy stackoverflow.]

No comments:

Post a Comment