Skip to Main Content
Expert Shell Scripting
book

Expert Shell Scripting

by Ron Peters
December 2008
Intermediate to advanced content levelIntermediate to advanced
320 pages
6h 45m
English
Apress
Content preview from Expert Shell Scripting

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. ...

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.
Start your free trial

You might also like

Robust Shell Scripting

Robust Shell Scripting

Arnold Robbins
Hacker Techniques, Tools, and Incident Handling

Hacker Techniques, Tools, and Incident Handling

Sean-Philip Oriyano, Michael Gregg

Publisher Resources

ISBN: 9781430218418Purchase book