Bash, apart from being a UNIX shell, is also a programming language in it’s own right.

Returning From Scripts

The return statement can be used to return from a function within a script.  return has nothing to do with the exit code.

The exit code of the last command run in a script is used as the exit code that is returned to the parent program.

ANSI Escape Codes

Bash supports various ANSI escape codes. This includes the commonly used codes to colour text printed to the terminal.