How to echo string to standard error (stderr)?
Answer:
To echo string to the standard error (stderr), rather than the standard output (stdout), you can define the following function in your shell (put in your ~/.bashrc file)
# function echo2() { echo "$@" 1>&2; }
Then you can execute the command like:
# echo2 test