InfraMaxx

Linux & OS Internals

Shell functions, arguments and getopts

Intermediate · 6 min read · quiz included

Six scripts share one copy-pasted disk check, and a bug fixed in five of them is still live in the sixth. Functions and getopts turn pasted code into one tool with options, and one quoting rule decides whether it is safe.

What is in the lesson

Read this lessonFree. No account needed.

More in Linux & OS Internals

All 85 Linux & OS Internals lessons