Cover by Ron Peters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 6Testing Variables and AssigningDefaults

Many scripts require a minimum set of input parameters or defined variables in order to run correctly. For example, they may contain customizable values used for configuration purposes, which are initially set to default values. In this chapter we'll look at various methods of testing variables and setting default values. The differences between many of these syntactical variants are subtle, but each is useful for working with undefined variables, setting variable defaults, and debugging.

All of the methods in this chapter check the state of a given variable and assign or substitute a value based on that assessment. The point here is to provide a variety of ways to perform these types of tasks. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required