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 7Indirect Reference Variables

It is possible to set a normal (direct) variable in three ways:

  • Directly, by assigning it a value
  • By storing the output of a command
  • By storing the results of some type of calculation

In all of these cases, although you might not know a variable's value in advance of any given point, you do know the name of the variable that is to receive the value.

For example, AGE=36 is a direct variable assignment. The value of 36 might change at a later stage and it may also have some calculation applied to it, but the variable name AGE will not change.

In some cases, however, you may need the ability to generate variable names on the fly. You may not know the number or names of variables you are going to need at the ...

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