echo输出到stderr

echo "Your error message here" >&2

This is a normal echo (which goes to stdout), however the >&2 (which is shorthand for 1>&2), means 'mix the stdout to the stderr'. 1 is stdout, and 2 is stderr here.

原文地址:https://www.cnblogs.com/emanlee/p/4869387.html