In this chapter, we'll begin by describing what variables are, and why we want and need them. We'll explain the difference between variables and constants. Next, we'll provide some possibilities with regard to variable naming and introduce some best practices on naming conventions. Finally, we'll discuss user input and how to properly deal with it: either with positional arguments or with interactive scripts. We'll end the chapter with an introduction to if-then constructs and exit codes, which we'll use to combine positional arguments and interactive prompts.
The following commands will be introduced in this chapter: read, test, and if.
The following topics will be covered in this chapter:
- What is a variable?
- Variable naming
- Dealing with user input
- Interactive versus non-interactive scripts