October 2024
Beginner to intermediate
698 pages
16h 7m
English
Often, an administrator will need to pass both arguments and options to a shell script. That’s easily done by passing positional parameters to the script, as we’ve seen in previous chapters. But, if you need to use normal Linux/Unix-style option switches, and you need to use arguments for certain options, then you’ll need a helper program. In this chapter, I’ll show you how to use getops to pass options, arguments, and options with arguments to a script.
Topics in this chapter include:
getoptsgetopt versus getoptsgetoptsSo, if you’re ready, let’s dig in.
You can use either your Fedora or your Debian ...
Read now
Unlock full access