February 2001
Beginner to intermediate
448 pages
9h 2m
English
Variables are used to store values. In the following equation, two variables—x and y—are given:
x + y = 4
In this particular case, you can infer that the values associated with the variables are numeric. But variables can just as easily be character-based. Variables are used extensively in programming, so more will be discussed later. A variable is a name/value pair. The variable has a name, called a varname—x and y, previously shown—and a value, such as 2 or /home/shell as seen in the following example:
$ echo $HOME /home/shell
The dollar sign ($) is placed in front of the varname to indicate that you are accessing the value of the variable. It forces the shell to check its table of variables to see whether it contains a variable ...
Read now
Unlock full access