Create a reusable shell function.
Section: Conditionals Loops and Functions
Define shell function
bash
bash
greet() { echo "hello $1"; }Explanation
Functions help keep scripts readable and avoid repetition.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Conditionals Loops and Functions