bash echo to stderr 1

bash echo to stderr

>&2 echo "error"

Here is what the above code is Doing:
1. The first line is a shebang. It tells the shell what program to use to interpret the script.
2. The second line is a comment. It’s ignored by the shell.
3. The third line is a command. It prints the string “hello” to the screen.
4. The fourth line is a command. It prints the string “error” to the screen, but it sends it to the standard error stream instead of the standard output stream.
5. The fifth line is a comment. It’s ignored by the shell.

Similar Posts