Introduction
Functions can take inputs to work with different data each time. Using $1, $2 inside a function lets you access these inputs easily.
You want to reuse a set of commands but with different values each time.
You need to pass a filename or user input to a function to process it.
You want to write a script that can handle multiple tasks by changing arguments.
You want to keep your script organized by breaking tasks into functions with inputs.