Introduction
In bash scripts, you use return and echo to send back results from functions. This helps you reuse code and get information from functions.
When you want a function to tell if it succeeded or failed using return codes.
When you want a function to send back some text or data using echo.
When you need to capture the output of a function to use later in your script.
When you want to check the status of a command inside a function.
When you want to print messages from a function to the screen.