For example#!/bin/bashINT=-5if [[ $INT =~ ^-?[0-9]+$ ]]; then    echo INT is an integer.else    echo INT is not an integer. >&2    exit 1fiWhen I delete >&2. There is nothing different. Why do I need to add >&2
Must I add >&2 in the end of echo command?
shell
The difference is:echo INT is an integer.writes to standard-out, andecho INT is not an integer. >&2writes to standard-error.In Unix-world, stdout is generally used when everything is working correctly and stderr is generally used to print messages when something goes wrong.By default, stdout and stderr both print to your screen. The main difference is that the > and | operators catch stdout by default, but not stderr.So if you had your script in the middle of a pipeline, INT is an integer. would continue down the pipeline and INT is not an integer would print to your screen instead of going into the pipeline.