Introduction
Functions let you group commands together to reuse them easily. They help keep your scripts neat and save time.
When you want to run the same set of commands multiple times.
To organize your script into smaller, understandable parts.
When you want to make your script easier to read and maintain.
To avoid repeating code and reduce mistakes.
When you want to pass information to a set of commands and get results back.