Add color to your bash script

Add color to your bash script

Longer scripts with a lot of output get confusing fast. A nice change of pace is working with colors there. For this you can use ANSI escape codes.

In a script this might look like this:

RED='\033[0;31m'
NC='\033[0m' # Reset color

printf "This is an ${RED}error${NC}, so do something\n"