Variables in an Autofs Map Entry
You can create a client-specific variable by prefixing a dollar sign ($
) to its name. The variable helps you to accommodate different architecture types that are accessing the same file system location. You can also use curly braces to delimit the name of the variable from appended letters or digits. The following table shows the predefined map variables.
Table 2-1 Predefined Map Variables
Variable | Meaning | Derived From | Example |
---|---|---|---|
|
Architecture type |
|
|
|
Processor type |
|
|
|
Host name |
|
|
|
Operating system name |
|
|
|
Operating system release |
|
|
|
Operating system version (version of the release) |
|
|
You can use variables anywhere in an entry line except as a key. For instance, suppose that you have a file server that exports binaries for SPARC and x86 architectures from /usr/local/bin/sparc
and /usr/local/bin/x86
respectively. The clients can mount through a map entry such as the following:
/usr/local/bin -ro server:/usr/local/bin/$CPU
The same entry for all clients now applies to all architectures.
Note:
Most applications that are written for any of the sun4 architectures can run on all sun4 platforms. The-ARCH
variable is hard-coded to sun4
.