Книга: Linux Network Administrator Guide, Second Edition
Variable names
Variable names
dip understands only a predefined set of variables. A variable name always begins with a dollar symbol and must be written in lowercase letters.
The $local and $locip variables contain the local host's name and IP address. When you store the canonical hostname in $local, dip will automatically attempt to resolve the hostname to an IP address and to store it in the $locip variable. A similar but backward process occurs when you assign an IP address to the $locip variable; dip will attempt to perform a reverse lookup to identify the name of the host and store it in the $local variable.
The $remote and $rmtip variables operate in the same way for the remote host's name and address. $mtu contains the MTU value for the connection.
These five variables are the only ones that may be assigned values directly using the get command. A number of other variables are set as a result of the configuration commands bearing the same name, but may be used in print statements; these variables are $modem, $port, and $speed.
$errlvl is the variable through which you can access the result of the last command executed. An error level of 0 indicates success, while a nonzero value denotes an error.
- 3.1.6 Variable Names
- 3.1.7 Variable Types
- 3.1.10 Static Variables
- 3.1.11 External Variables
- 8.5.2 Typical Condition Variable Operations
- Using Double Quotes to Resolve Variables in Strings with Embedded Spaces
- namespace-uri()
- Access Variable Data Files in the
- Using Environment Variables
- How Nameservers Store DNS Structure Information
- Configuring a Local Caching Nameserver
- Running the named Nameserver Daemon