The set command
The set builtin command is one of the most misunderstood (and overloaded!) commands in Bash. It does several different things depending on how it's called: show names, set shell options, and set shell positional parameters.
First of all, when run on its own with no arguments, set prints a list of all of the variables and any functions for the running shell, in alphabetical order. It includes the full definition of the functions. This is one of several ways to view all of the variables in the shell. We suggest you use declare instead, explained later in this chapter, as it shows more information about properties of the variables.
Secondly, set allows you to specify certain options for how the shell runs, all options starting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access