Coloring shell scripts

Adding color to shell scripts is actually quite easy. Here’s an excellent page describing how: http://misc.flogisoft.com/bash/tip_colors_and_formatting

I would add that it becomes easier if you use variables. Then, it’s almost like a css class for your terminal output. For example, if I want to make bold green success text output by one of my scripts, I might do something like this:

#!/bin/bash
SUCCESS='\033[1;32m' # Bold;Green
NC='\033[0m' # No Color
# ...commands
echo "Almost there..."
echo -e "${SUCCESS}Success!${NC}" #shows in bold green

The -e after echo enables the parsing of escape sequences. It’s important to have there.

There are a lot more ways you can use the formatting for your scripts. Explore and enjoy!