In scripts, errors are usually sent to file descriptor 2 with
echo "error" >&2
/dev/stderr is used instead:
echo "error" > /dev/stderr
/dev/stderr, I see that it is only a symlink to
/proc/self/fd/2 , which in turn is a symlink to
/dev/pts/5 (on my current terminal).
Seems little bit over complicated. Is there some logic behind that ?
&2 equivalent ?
Is any of those preferred over the other ?