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.
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.