Main index

Introducing UNIX and Linux


Advanced shell programming

Overview
Sending and trapping signals
      Signal names
Functions
Aliases
The 'exec' mechanism
The 'eval' mechanism
Sending data across networks
      Sending printable characters
      Splitting files
Makefiles
Safe programming
Setting up a terminal
More on files
Miscellaneous utilities
Summary
Exercises

Answer to chapter 9 question 7

This is simple use of eval.

printf "Type in a variable name: "
read VARIABLE

# Construct the name of the variable
#   and echo its value
eval echo \$$VARIABLE

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck